Liberty BASIC Community Forum
« Odd behaviour with 'prompt' »

Welcome Guest. Please Login or Register.
Oct 23rd, 2017, 02:50am


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Odd behaviour with 'prompt'  (Read 209 times)
tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1167
xx Odd behaviour with 'prompt'
« Thread started on: Jan 13th, 2016, 09:47am »

From the manual...
Quote:
' The PROMPT statement opens a dialog box, displays the message contained in "string expression",
' and waits for the user to type a response in the textbox and press the ENTER key,
' or press the OK or Cancel button on the dialog.

Today I was using 'prompt' and found that after a first call of 'prompt' it no longer waited! Try the code below. It waits for the first 'notice', but not for the rest..
This WAS sometime after midnight, on LB4.5, and I AM working via Ubuntu/Linux. Am I dreaming? No access here to another machine running MS to test if it's linux-only..
Code:
    nomainwin

    for i =1 to 10
        prompt "What to do with this file" +chr$( 13) +"<R>etain, <D>elete, or <N>ame"; response$

        timer 2000, [carryOn]: wait
      [carryOn] timer 0

    next i
 
« Last Edit: Jan 13th, 2016, 09:53am by tenochtitlanuk » User IP Logged

CarlGundel
Administrator
ImageImageImageImageImage


member is offline

Avatar

author of Liberty BASIC


Homepage PM


Posts: 2833
xx Re: Odd behaviour with 'prompt'
« Reply #1 on: Jan 13th, 2016, 11:19am »

This is a known bug. I have recently spent many hours trying to eradicate this from Liberty BASIC, but there's something really tricky about it because of the way the prompter popup is implemented. It is part of the Smalltalk library of popup windows and so the solution remains elusive.

I'm considering writing my own prompter popup so that I have complete control over how that all works.

-Carl
User IP Logged

author of Liberty BASIC
http://www.libertybasic.com
tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1167
xx Re: Odd behaviour with 'prompt'
« Reply #2 on: Jan 13th, 2016, 12:02pm »

Thanks, Carl!
Not the end-of-the-world for me.

You might be amused /sympathetic about why I wanted it. I carelessly backed up an 8G memory card over the first 8G of a 150G hdd data drive. I can recover files from the remaining part, but they are not named nor typed UNLESS they have embedded ID like jpg, gif, mp3, bmp, etc so the recovery software lumps together things like bas, txt, log etc files. I wrote an LB program to display all these 'text' files' for a few seconds while I decided what they were, and resave with the correct type. ( I thought of analysing by length, content vocabulary, or other characteristics, but it gets too messy and complex. Humans are much better at rapid recognition of displayed text)
User IP Logged

GaRPMorE
Senior Member
ImageImageImageImage


member is offline

Avatar

"Not everything that counts can be counted, and not everything that can be counted counts." - Albert Einstein


PM


Posts: 289
xx Re: Odd behaviour with 'prompt'
« Reply #3 on: Jan 13th, 2016, 2:24pm »

Eliminate the timer, and no problem:
Code:
    mainwin 20 10
    'nomainwin
    for i=1 to 3
        prompt "What to do with this file" +chr$( 13) +"<R>etain, <D>elete, or <N>ame";res$
        print i;": ";res$;" was selected."
       ' timer 5000, [carryOn]: wait
'[carryOn] timer 0
    next
    end
 

I probably would chose a GUI with Radiobuttons, though.
« Last Edit: Jan 13th, 2016, 2:29pm by GaRPMorE » User IP Logged

from the world according to GaRPMorE
tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1167
xx Re: Odd behaviour with 'prompt'
« Reply #4 on: Jan 13th, 2016, 4:05pm »

Quite. Was just reporting a bug I'd not noticed before. In the full program I had a good reason for the delay...
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls