Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2003
    Posts
    45

    Help on text string neded please

    Hi,

    I am trying to create an application that collects data from 12 input fields, and concat them to one long string, so that it maybe output to a text file.

    This file when complete would be uploaded to a server and the string is then read IN to a flash movie. I have the upload, write to text bit sorted, but can not work out how to make my required string to sotre in the text file.

    I need to output to a .txt file in the following format exactly

    fieldname1=Result1&fieldname2=Result2&fieldname3=R esult3 etc..

    My problem is this. I need to use = and the & characters in my final string. Which I know are reserved

    Any help appreciated
    Cheers
    Drew

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    This should do the trick.

    Code:
    result1 = Input.GetText("field1")
    result2 = Input.GetText("field2")
    result3 = Input.GetText("field3")
    
    sOutput = "field1="..result1.."&field2="..result2.."&field3="..result3
    Dermot

    I am so out of here

  3. #3
    Join Date
    Oct 2003
    Posts
    45
    That's very kind of you, thank you very much. It works a treat!

    Cheers
    Drew

  4. #4
    Join Date
    Oct 2003
    Posts
    45

    Masking -Filtering Input Question

    Hi,

    I have tried Masking each input field using ### to only allow Numerical input of a maximum 3 digits, this works fine, except when there is an input of only 2 digits.

    The string...

    sOutput = "field1="..result1.."&field2="..result2.."&field3= "..result3

    Ends up like sOutput = "field1="123"&field2="12 "&field3="123

    Field 2 has a whitespace after the result of 12 this would cause errors in the Flash file reading of the string.

    I have tried changing the option from "Formatted" to "As Typed". But this does not make a difference.

    So I guess my question is, is there a Mask character that would not show a whitespace in the result if no 3rd character was input.

    Or is there anyway I can just say only accept numbers?

    OR is there anyway to auto strip the whitespace from my sOutput string?

    Thanks in advance
    Cheers
    Drew

  5. #5
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    The best thing is to use the String.TrimRight() function to remove any trailing blank spaces

    Code:
    result1 = String.TrimRight(Input.GetText("field1"), nil)
    result2 = String.TrimRight(Input.GetText("field2"), nil)
    result3 = String.TrimRight(Input.GetText("field3"), nil)
    
    sOutput = "field1="..result1.."&field2="..result2.."&field3="..result3
    Dermot

    I am so out of here

  6. #6
    Join Date
    Oct 2003
    Posts
    45
    Once again, you have solved my problem.

    Many thanks once again!

    That final problem, I am pleased to say, completes this project for me.

    Cheers
    Drew

  7. #7
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    No problem. Glad to hear you got it all working.
    Dermot

    I am so out of here

Similar Threads

  1. Example: Loading Paragraph Text Using a Timer
    By Jonas DK in forum AutoPlay Media Studio 5.0 Examples
    Replies: 7
    Last Post: 11-25-2004, 05:10 PM
  2. Comparing a string / text?
    By patrick6 in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 03-21-2004, 05:40 PM
  3. Parse a text string
    By GertVA in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 03-24-2003, 06:08 AM
  4. HOWTO: Display Conditional Text Based Upon a List Box Selection
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-15-2002, 10:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts