Announcement

Collapse
No announcement yet.

String Manipulation - please help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • herrin
    replied
    Originally posted by Kasito View Post
    Thanks a million bro, you have solved my problem and have well implemented it. It works great!
    I actually forgot the 1 back slash and have always think a comma in between variables but you have cleared me. Thanks again.



    if you have solved the problem what do you need to know if my doubt was founded?

    Leave a comment:


  • Kasito
    replied
    herrin, your code is now downloadable so how can i confirm your doubt? please correct the issue so we can look at it.

    Leave a comment:


  • herrin
    replied

    I doubt the problem was the backslash.........




    Code:
    [ATTACH]n303952[/ATTACH]

    Leave a comment:


  • Kasito
    replied
    Originally posted by Imagine Programming View Post
    Code:
    Qans2 = TextFile.ReadToString("AutoPlay\\Docs\\pool\[COLOR=#FF0000][B]\[/B][/COLOR]" .. asubject1.. "\\q2011\\2ans.txt");
    - Did you forget a backslash there? Without two backslashes, you'll be escaping the next character instead. I later noticed a comma in stead of the concatenation operator as well

    Thanks a million bro, you have solved my problem and have well implemented it. It works great!

    I actually forgot the 1 back slash and have always think a comma in between variables but you have cleared me. Thanks again.

    Leave a comment:


  • BioHazard
    replied
    Something like this, you mean?
    Code:
    Qans2 = TextFile.ReadToString("AutoPlay\\Docs\\pool\\asubject1\\q2011\\2ans.txt"); 
    Image.Load("Ans"..Qans2, "AutoPlay\\Images\\tick.png");


    It's hard to discern exactly what you're after - but try my example, attached.
    Attached Files

    Leave a comment:


  • Imagine Programming
    replied
    Code:
    Qans2 = TextFile.ReadToString("AutoPlay\\Docs\\pool\[COLOR=#FF0000][B]\[/B][/COLOR]" .. asubject1.. "\\q2011\\2ans.txt");
    - Did you forget a backslash there? Without two backslashes, you'll be escaping the next character instead. I later noticed a comma in stead of the concatenation operator as well
    Last edited by Imagine Programming; 09-21-2019, 05:03 PM.

    Leave a comment:


  • Kasito
    replied
    I mean this line of code:

    Qans2 = TextFile.ReadToString("AutoPlay\\Docs\\pool\\asubj ect1\\q2011\\2ans.txt");


    This is what im trying to do:

    Qans2 = TextFile.ReadToString("AutoPlay\\Docs\\pool\", asubject1.. "\\q2011\\2ans.txt");


    I Mean, how do i do the above properly?

    Leave a comment:


  • Kasito
    replied
    herrin, sincerely i dont seem to understand what you mean i should copare. can you elaborate a little on the example?

    Compare = String.CompareNoCase(sQuans, "1"); if (Compare == 1) then
    Note that my issue is "asubject1 variable, not the Qans as you referred.

    Leave a comment:


  • herrin
    replied

    Code:
    Compare = String.CompareNoCase(sQuans, "1");
    if (Compare == 1) then

    Leave a comment:


  • Kasito
    started a topic String Manipulation - please help

    String Manipulation - please help

    I have a code and dont know how to include a variable name "asubject1" in a TextFile.ReadToString address. The variable has the subject name which determines the location.

    Example Code:


    if asubject1 then

    Qans2 = TextFile.ReadToString("AutoPlay\\Docs\\pool\\asubj ect1\\q2011\\2ans.txt");

    if Qans2 == "1" then Image.Load("Ans1", "AutoPlay\\Images\\tick.png");

    elseif Qans2 == "2" then Image.Load("Ans2", "AutoPlay\\Images\\tick.png");

    elseif Qans2 == "3" then Image.Load("Ans3", "AutoPlay\\Images\\tick.png");

    elseif Qans2 == "4" then Image.Load("Ans4", "AutoPlay\\Images\\tick.png");
    end
    end
    Please i need help with example. Thanks.
Working...
X
😀
🥰
🤢
😎
😡
👍
👎