Hi guys! Im using bah.format module and because I´m creating na interpreter I need to know whats the next format in the control string. So, after I create the formatter objectec, how can I know the next type in the format sequence ? See the code bellow:
Function RunFormat$(sc:TScript, id:TIdentifier)
Local format$
Local formatter:TFormatter
Local value#
sc.MatchToken(id.token)
sc.MatchToken(TOKEN_OPEN_PAR)
format = sc.StrExpression()
formatter = TFormatter.Create(format) 'Here I need to know what is the next type
sc.MatchToken(TOKEN_COMMA)
'Hipotetical code
while (formatter.HasNext())
if Formatter.NextType() = TYPE_FLOAT
local value:Float = NumExpression()
Formatter.FloatArg(value)
endif
if Formatter.NextType() = TYPE_STRING
local value:Float = StrExpression()
Formatter.StringArg(value)
endif
wend
Return Formatter.Format()
End Function
Thanks!
|