FW: [NEW:V4MD] Symbols handling
Ruslan Zasukhin
sunshine at public.kherson.ua
Fri Aug 13 16:52:38 CDT 2004
>
> Symbols support added in V4MD so now users will
> be able to use named constants (symbols) - like #kServer - instead of
> meaningless number 2.
>
> Also kernel errors now expressed as symblos too.
> So instead of testing for meaningless error code like
>
> if ValentinaError() = 2 then
> ...
> end if
>
> users can now write
>
> if ValentinaErrorIs(#ERR_OS_FILE_NOT_FOUND) then
> ...
> end if
This is just great!
> (I do not remember whether mapping system errors into Valentina errors
> was already done but we can already use such syntax).
Some OS errors was wrapped by our codes, but still there is work here.
> Also one more new function added to get last error symbol:
> ValentinaErrorSymbol()
> Currently this function returns error symbol as string.
> (I cannot force it to return symbol - I've asked about this
> on the Macromedia list).
ok
> But now we can also write:
>
> ValentinaInit("", 8 * 1024 * 1024, "", "")
>
> set err = ValentinaErrorSymbol()
> if( symbol(err) = #ERR_SUCCESS ) then
> alert("OK")
> end if
>
> and this works.
Igor, first of all we must find solution to return symbols.
Above example is not good, because it have different syntax.
> May be we need to choose only one syntax form to use in V4MD?
> I mean choose between
> ValentinaErrorSymbol() (this comes to my mind later)
> and
> ValentinaErrorIs()?
Yes, if we will be able return symbols then I prefer
Valentina.DoSomething()
if( ValentinaError() != #ERR_SUCCESS )
Interesting, can 2 Xtras in the same project conflict if they use the same
symbol? Please ask on Xtra list.
> As for me first form is more native and it has advantage over
> second form: if user wrote #ERR_SACCESS (instead of #ERR_SUCCESS)
> he/she easily can see this in the debugger and correct the code.
> With second form he/she cannot do this.
>
More information about the Valentina-beta
mailing list