DIALOG with negative selection type
Root / Programming Questions / [.]
12Me21Created:
From InstructionList.pdf:
DIALOG (4) Displays a dialog and waits for the Touch Screen or a hardware button to be pressed
Format Variable = DIALOG("Text string",Button type,["Caption string"],[Timeout period])
Arguments
: Text string
: :Character string to display in the dialog
: Button type
: : |b00| ABXY buttons (1)
: : |b01| +Control Pad (2)
: : |b02| L,R buttons (4)
: : |b03| Touch Screen (8)
: : Specify a value for which the logical OR is calculated with the above bit value and the sign is reversed
: : ZL and ZR buttons cannot be detected
: : -1 causes only ABXY to be specified
: : For example, to detect ABXY and +Control Pad, -3 should be specified
: Caption string
: :Character string to display in the caption field at the top of the dialog
: Timeout period
: :Number of seconds to wait before closing the dialog automatically (if omitted, 0: Not closed)
Return Values
: 128: A button pressed
: 129: B button pressed
: 130: X button pressed
: 131: Y button pressed
: 132: +Control Pad up pressed
: 133: +Control Pad down pressed
: 134: +Control Pad left pressed
: 135: +Control Pad right pressed
: 136: L button pressed
: 137: R button pressed
: 140: Touch Screen pressed
Examples
: R=DIALOG("ABXYLR/+Control Pad/Touch",-15,"Special",0)
As for XSCREEN 4, it's best to make one post per one bug report.
I'm using the second DIALOG type:
DIALOG "Text string",[selection type],["caption string"],[timeout period]
(the help menu actually has a mistake, but that's a whole different bug)
Anyway, under selection type, it lists:
0: OK (default)
5: Next
which is weird, because the actual range is like -15 to 5
I'm using the second DIALOG type: DIALOG "Text string",[selection type],["caption string"],[timeout period] (the help menu actually has a mistake, but that's a whole different bug) Anyway, under selection type, it lists: 0: OK (default) 5: Next which is weird, because the actual range is like -15 to 5The manual is simply written in a way to make it easier to understand/flow better for beginners. The actual DIALOG instruction can be boiled down to just a few use cases.
I'm using the second DIALOG type: DIALOG "Text string",[selection type],["caption string"],[timeout period] (the help menu actually has a mistake, but that's a whole different bug) Anyway, under selection type, it lists: 0: OK (default) 5: Next which is weird, because the actual range is like -15 to 5If you're not using 'selection type' values of 0 or 5, then you are not using the second DIALOG type.
no... 4: Format Variable = DIALOG("Text string",Button type,["Caption string"],[Timeout period]) 'parentheses 2: DIALOG "Text string",[selection type],["caption string"],[timeout period] 'no parentheses The only dialogs without parentheses are 1 and 2.I'm using the second DIALOG type: DIALOG "Text string",[selection type],["caption string"],[timeout period] (the help menu actually has a mistake, but that's a whole different bug) Anyway, under selection type, it lists: 0: OK (default) 5: Next which is weird, because the actual range is like -15 to 5If you're not using 'selection type' values of 0 or 5, then you are not using the second DIALOG type.
If you're not using 'selection type' values of 0 or 5, then you are not using the second DIALOG type.Yeah, 12Me21 is actually right here. There's only two or three proper varieties of DIALOG, so the manual splitting this page into two is entirely unnecessary. It only serves the purpose of simplifying the documentation. There's actually a typo in there, as the DIALOG instruction can be called entirely as a function or OUT command in any format. The manual doesn't do DIALOG very well.
The PTC help menus have never been know for being the best, but DIALOG's entries are especially bad.
There are 2 types of dialog, each of which has multiple variants but do the same thing.
DIALOG message$[,[button_type],[caption$],[timeout_period]]
result_ = DIALOG(message$[,[button_type],[caption$],[timeout_period]])
DIALOG message$[,[button_type],[caption$],[timeout_period]] OUT result_
Button Types:
0: OK (default)
1: No/Yes
2: Back/Next
3: Cancel/Confirm
4: Cancel/Execute
5: Next
-Button Codes (negative) (Can be OR'd to allow multiple types):
-1: ABXY
-2: D-Pad
-4: L/R
-8: touch screen
'Text input dialog (designed for file names)
result$=DIALOG(initial$,caption$[,maximum])
DIALOG initial$,caption$[,maximum] OUT result$
Use RESULT to check the selection for all types of DIALOG:
-1 = left button (no)
0 = timeout
1 = right button (yes)