No announcement yet.

Hey guys... having problems writing to a text file

  • Filter
  • Time
  • Show
Clear All
new posts

  • Hey guys... having problems writing to a text file

    I'm trying to get a load of edit fields to write to a specific text file.

    The code is probably a bit long but I thought it would work.... Only problem is it's only adding the first variable %1% and nothing else. Tried a few things, like writing a text file with everything in it at once, but it just still puts %1% and a load of returns, until it's finished the list and then puts in %1% again....

    Any ideas?

    Code below for "On Mouse Click"....

    %29% = EditFieldObject[EditField15].GetText
    %28% = TextBoxObject[TextBox6].GetText
    %27% = EditFieldObject[EditField12].GetText
    %26% = EditFieldObject[EditField11].GetText
    %25% = EditFieldObject[EditField10].GetText
    %24% = EditFieldObject[EditField9].GetText
    %23% = EditFieldObject[EditField8].GetText
    "% = EditFieldObject[EditField7].GetText
    %21% = TextBoxObject[TextBox5].GetText
    %20% = TextBoxObject[TextBox4].GetText
    %19% = TextBoxObject[TextBox3].GetText
    %18% = TextBoxObject[TextBox2].GetText
    %17% = TextBoxObject[TextBox1].GetText
    %16% = EditFieldObject[Address1].GetText
    %15% = EditFieldObject[BookingLevel].GetText
    %14% = EditFieldObject[EditField5].GetText
    %13% = EditFieldObject[EditField4].GetText
    %12% = EditFieldObject[EditField2].GetText
    %11% = EditFieldObject[EditField1].GetText
    %10% = EditFieldObject[Country].GetText
    %9% = EditFieldObject[ZipCode].GetText
    %8% = EditFieldObject[City].GetText
    %7% = EditFieldObject[Address2].GetText
    %6% = EditFieldObject[Address1].GetText
    %5% = EditFieldObject[TelephoneNumber].GetText
    %4% = EditFieldObject[EmailAddress].GetText
    %3% = EditFieldObject[LastName].GetText
    %2% = EditFieldObject[FirstName].GetText
    TextFile.Write ("C:\StephensTest.txt", "%1%")
    TextFile.InsertLine ("C:\StephensTest.txt", "%2%", -1)
    TextFile.InsertLine ("C:\StephensTest.txt", "%3%", -1)
    TextFile.InsertLine ("C:\StephensTest.txt", "%4%", -1)
    TextFile.InsertLine ("C:\StephensTest.txt", "%5%", -1)
    TextFile.InsertLine ("C:\StephensTest.txt", "%6%", -1)

    I should also probably explain that %1% is set from a list box, Mr. or Ms. and that is the only thing that is showing in the text file.

    I have them declared as %1% %2% etc so I can also email them with the %0A and %0D switches, which I forgot and had to come here to get them.... will this work by cutting down on the mailto: command? I read on here somewhere that different programmes only let you have a certain amount of text in the mailto?

    Thanks for reading down this far and not falling asleep!

    If you can read this, i have yet to write a witty and imaginative signature.... sorry...

  • #2
    Re: Hey guys... having problems writing to a text file

    That won't help the mailto command, since it's the contents of the variables that are sent in the mailto -- the variables are expanded before the mailto is sent. It doesn't matter how long the variable names are. As with people, it's what's inside that counts. [img]/ubbthreads/images/icons/smile.gif[/img]
    --[[ Indigo Rose Software Developer ]]