Switch to desktop version  
String type in basic - Printable Version

+- Ewon Technical Forum (https://techforum.ewon.biz)
+-- Forum: Development (https://techforum.ewon.biz/forum-50.html)
+--- Forum: BASIC Script (https://techforum.ewon.biz/forum-52.html)
+--- Thread: String type in basic (/thread-1306.html)



String type in basic - khaterchi - 12-05-2020

Hello,

I have two issues :

  1. How can I cast a String into integer in basic like
    index$=“2”
    i%=index$

  2. I want to get the variable name dynamically by iteration
    FOR a% = 1 TO 5
    colN$=(columnName+STR$(a%))!
    OPEN “test.csv” FOR BINARY APPEND AS 1
    PUT 1,colN$ +CHR$(13)+CHR$(10)
    CLOSE 1
    NEXT a%
    PS: the columnName is the adress of an input text(HTML)
Thanks in advance


RE: String type in basic - tedsch - 14-05-2020

These issues are addressed in the following post.

https://forum.hms-networks.com/t/basic-string-type/58979/7


RE: String type in basic - khaterchi - 14-05-2020

Hello,

 
For the second issue I need it to create a report (csv file), in each line contains Column 1, Column 2,... Column 10 submitted  from a html page, as it's montioned in the image capture1 below, and that columns are created dynamically by the button "add column", and each html element(input text, checkbox,...) for every line has a different adress. To create the report I use the special forms by sending basic commands line that supports only 255 character, then to declare (**) all these inputs in basic command line will exceed the limit number of characters. 
[font=Tahoma, Verdana, Arial, sans-serif][font=Tahoma, Verdana, Arial, sans-serif][font=Tahoma, Verdana, Arial, sans-serif]Can I create a basic variable name dynamically ? or [/font][/font][/font][font=Tahoma, Verdana, Arial, sans-serif]Is there any ot[/font][font=Tahoma, Verdana, Arial, sans-serif]her solution? [/font]

(**) <input type="hidden" name="Command1" value='
columnName1$= columnName1!
variable1$= variable1! 
fct1$= function1!
dec1$= dec2!

columnName2$= columnName2!
[font=Tahoma, Verdana, Arial, sans-serif]variable2$= variable2! [/font]
[font=Tahoma, Verdana, Arial, sans-serif]fct2$= function2![/font]
[font=Tahoma, Verdana, Arial, sans-serif]dec2$= dec2![/font]


[font=Tahoma, Verdana, Arial, sans-serif]//.... etc until [/font]

[font=Tahoma, Verdana, Arial, sans-serif][font=Tahoma, Verdana, Arial, sans-serif]columnName10$= columnName10![/font][/font]
[font=Tahoma, Verdana, Arial, sans-serif][font=Tahoma, Verdana, Arial, sans-serif]variable10$= variable10! [/font][/font]

[font=Tahoma, Verdana, Arial, sans-serif]fct10$= function10![/font]
[font=Tahoma, Verdana, Arial, sans-serif][font=Tahoma, Verdana, Arial, sans-serif]dec10$= dec10!
[/font]
[/font]


//...
'>

 
All thoughts will be appreciated.