Hello,
I've enhanced FBSL_GetProp and FBSL_SetProp functions in order to simplify their use.
- FBSL_GetProp is now capable of supporting the $ POSTFIX, this avoids to use To_Lpstr( FBSL_GetProp(... ) ) to retrieve its String content, the simple use of FBSL_GetProp$ will do it for you !
- FBSL_SetProp is now capable of supporting auto detection of its last parameter, this avoid to prepend the pointer @mystringparameter if the latest parameter was a string, just type the name of your variable and it'll be OK !
Code:
#Uses "@|*"
#option Explicit
#AppType CONSOLE
Dim %myvalue = 1971
Dim $myscript = "Hello from outta spaaaaaaaaace!!!"
Dim $PROP = "TEST"
Dim $OTHER = "SCRIPT"
Dim Sc, %i
Sub Main()
Sc = SCNew()
Fbsl_SetProp( Me, PROP, myvalue )
'// => We can get rid off '@myscript' because autodetermination is used
Fbsl_SetProp( Me, OTHER, myscript )
? "-------------ENUM PROPERTIES--------------------"
Fbsl_EnumProp( Me, Sc )
For i = 1 To ScGetCount( Sc )
? "'Me' property#", i, "=", ScIndexAt( Sc, i )
Next i
? "-------------PRINT PROPERTIES--------------------"
? PROP , "=", Fbsl_GetProp( Me, PROP )
'// => We can get rid off 'To_Lpstr' because $ postfix is used
? OTHER, "=", Fbsl_GetProp$( Me, OTHER )
Fbsl_RemoveProp( Me, PROP )
Fbsl_RemoveProp( Me, OTHER )
ScFinalize( Sc )
Resize( Me, 0, 0, 150, 40 )
Center( Me )
Show( Me )
Begin Events
End Events
End Sub
Will now output :
Code:
-------------ENUM PROPERTIES--------------------
-------------PRINT PROPERTIES--------------------
TEST=1971
SCRIPT=Hello from outta spaaaaaaaaace!!!