none
Oskariok Data extension question RRS feed

  • Question

  • When I use the dialogs.AskForTextLine, it returns what was typed in the text box. What about the "Cancel" button? is there anything returned if it are clicked? It seems like it returns nothing. I would like to have an event happen if "Cancel" is clicked  and different event if the "OK" button is clicked and the textbox is left blank. Is this possible or am I not understanding the dialog correctly?

    Thanks,

    Steve

    Tuesday, February 8, 2011 6:33 PM

Answers

  • When you use the dialog then click cancel, it returns nothing. So you could use that to your advantage:

    a = Dialogs.AskForTextLine("Enter your name, or nothing for no name:", "Name:")
    If a <> "" Then
        TextWindow.Writeline(a)
    EndIf

     

    Or not:

    a = Dialogs.AskForTextLine(Enter your name. You Must Have one:", "Name:")
    TextWindow.Writeline(a)
    'This can be fixed with:(first uncomment all following lines)
    'label:
    'a = Dialogs.AskForTextLine(Enter your name. You Must Have one:", "Name:")
    If a = "" Then
        Goto label
    Else
        TextWindow.Writeline(a)
    EndIf

    ~~AirWaves!!~~
    • Proposed as answer by litdevModerator Tuesday, February 8, 2011 9:49 PM
    • Marked as answer by SFC-P33A Wednesday, February 9, 2011 8:09 PM
    Tuesday, February 8, 2011 7:39 PM

All replies

  • When you use the dialog then click cancel, it returns nothing. So you could use that to your advantage:

    a = Dialogs.AskForTextLine("Enter your name, or nothing for no name:", "Name:")
    If a <> "" Then
        TextWindow.Writeline(a)
    EndIf

     

    Or not:

    a = Dialogs.AskForTextLine(Enter your name. You Must Have one:", "Name:")
    TextWindow.Writeline(a)
    'This can be fixed with:(first uncomment all following lines)
    'label:
    'a = Dialogs.AskForTextLine(Enter your name. You Must Have one:", "Name:")
    If a = "" Then
        Goto label
    Else
        TextWindow.Writeline(a)
    EndIf

    ~~AirWaves!!~~
    • Proposed as answer by litdevModerator Tuesday, February 8, 2011 9:49 PM
    • Marked as answer by SFC-P33A Wednesday, February 9, 2011 8:09 PM
    Tuesday, February 8, 2011 7:39 PM
  • Thanks AirWaves, I'll give it a try
    Tuesday, February 8, 2011 8:37 PM