
Originally Posted by
Joacim Andersson
How are you handling assignments?
Code:
%s = _textbox.text
Or when there are no spaces?
Little change of format all function/params are inside of brackets {} instead of () this is because i had a problem with the $calc{} that also accepts () so i had to approach it from this way.
To your qeustion:
I have a ($) identifier for that, lets say i have declared a name "form" that represents my current app form
then i would get it's property like this:
Code:
function GetAppTitle
%title = $object{form,text}
echo My app title is: %title
end function
The format of " = " is before handling replaced with the correct format, with the exception to replace just on 1 occourence so that it will not filter the rest out if that holds a "=" as well.
Code part wich is responsible for that:
Code:
If (Left(Line, 1) = F2Tables.C_VARIABLE) Then
' Here is that part, looks for a wrong format
If (InStr(Line, F2Tables.C_VARIABLE_SET_DELIM_WRONG, CompareMethod.Text) > 0) Then
'Replace it but just once so it wont reformat the value
Line = Replace(Line, F2Tables.C_VARIABLE_SET_DELIM_WRONG, F2Tables.C_VARIABLE_SET_DELIM, 1, 1)
End If
If (InStr(Line, F2Tables.C_VARIABLE_SET_DELIM) > 0) Then
Dim p() As String = Split(Line, F2Tables.C_VARIABLE_SET_DELIM, 2)
If (p.Length < 1) Then GoTo NextLine
Dim cVar As String = p(0) : Dim cVal As String = p(1)
cVal = EvalVars(cVal) : cVal = IdentifierParser.Parser(cVal, Me) : Variables.UpdateVar(cVar, cVal)
GoTo NextLine
End If
End If
Example script:
Code:
function start
%title=$object{form,text}=some text with = = == = = =
echo %title
end function
This will output exactly what i want and will leave the other '=' occourences alone.
It works but im sure it could be done in a different way i guess.
- Barret