-=:: FBSL ::=-

(C)2001-2010 by Gerome GUILLEMIN, Mehdi BOUAZIZ and Mike LOBANOVSKY
It is currently Wed Sep 08, 2010 2:16 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: FBSL_Get|SetProp enhancement
PostPosted: Mon Dec 07, 2009 10:54 am 
Offline
FBSL Administrator
FBSL Administrator
User avatar

Joined: Sat Mar 12, 2005 8:06 pm
Posts: 2877
Location: Paris -- France
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!!!


_________________
Yours,

(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
:: Full SETUP w. HELP 07th of September 2010 ::
http://gedd123.free.fr/FBSLv3.exe [3.4.0.7]
http://gedd123.free.fr/FBSLv3bin.zip [minimal]
Laissons les jolies femmes aux hommes sans imagination. / Let us leave pretty women to men without imagination.(M.Proust)
The success is a defeat for the one who does not want to dance any more! (H.F. Thiefaine)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group