Livecode scanf equivalent?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 6
- Joined: Sat Dec 26, 2015 11:20 am
Livecode scanf equivalent?
Hi, is there a Livecode equivalent to scanf C function? It should be the opposite of the Livecode Format function.
Re: Livecode scanf equivalent?
Hi Mario,
not sure, maybe the ASK dialog?
Best
Klaus
not sure, maybe the ASK dialog?
Code: Select all
...
ask "Please enter your name:"
put it into tUserAnswer
## user clicked CANCEL:
if tUserAnswer = EMPTY then
## or:
## if the RESULT = "cancel" then
exit to top
end if
answer "Your name is:" && tUserAnswer
...
Klaus
-
- Posts: 6
- Joined: Sat Dec 26, 2015 11:20 am
Re: Livecode scanf equivalent?
No, the scanf equivalent shoud fill a number of variables taking the values from partes of a string according to a template (look at the "format" Livecode function to have an idea, it makes to opposite).
Re: Livecode scanf equivalent?
Aha, sorry, no idea then...
Re: Livecode scanf equivalent?
Maybe matchText() is what you want?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Livecode scanf equivalent?
For anyone with time in their hands, this includes a list of scanf options:
https://en.m.wikipedia.org/wiki/Scanf_format_string
Probably most efficient to write an external for this, using any of the common C libs.
https://en.m.wikipedia.org/wiki/Scanf_format_string
Probably most efficient to write an external for this, using any of the common C libs.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 6
- Joined: Sat Dec 26, 2015 11:20 am
Re: Livecode scanf equivalent?
Effectively matchtext() seems to be the closer function to scanf at least for what concern the result, even if it uses regex.