aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #1174

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 1174  Why does this code make my Palm freeze?

17/03/2005 @ 22:20
by Joshua Cook

Anonymous



I am attempting to write a routine that will right justify a text field. It works to a point. I am wondering if anyone could take a look at it and tell me why it freezes my Palm when I erase the last character from the text field? I am sure it is something obvious, but I am not seeing it.

Here is the code. Please don't laugh. I am still learning! <img src="http://www.aldweb.com/inc/img/smileys/biggrin.gif">

' Spacetest.ibas
{creatorid "LDIk"}
{version "1.0"}
{parser on}

BEGIN
dim %textwidth%, %space$­­, %fieldwidth%
dim %fieldnum%,%spacewidth%,%fontnum%
dim %numspaces%, %curfieldval$­­, %oldfieldval$­­
%fontnum%=0
%spacewidth%=fontwidth(" ",%fontnum%)
%fieldwidth%=28
textfield #1,"1000",0,105,40,%fieldwidth%,14
label #2,"",105,70
%fieldnum%=1 : gosub _rightjustify
repeat
e=doevents
%fieldnum%=1: gosub _rightjustify
'w=0.25:gosub _wait
until e=-1
END

_rightjustify:
{parser on}
%curfieldval$­­=field$­­(#%fieldnum%)
if %oldfieldval$­­="" then
'print "old before is ": print %oldfieldval$­­
%curfieldval$­­=trim$­­(%curfieldval$­­)
%oldfieldval$­­=%curfieldval$­­
'print "old after is " : print %oldfieldval$­­
end if

%oldfieldval$­­=trim$­­(%oldfieldval$­­)
%curfieldval$­­=trim$­­(%curfieldval$­­)
'print %
if %oldfieldval$­­=%curfieldval$­­ then
'print "nothing to do!"
else
%textwidth%=fontwidth(%curfieldval$­­,0)
updatelabel #2,%curfieldval$­­
if %curfieldval$­­="" then
flushevents
print "equals nothing"
else
%numspaces%=(%fieldwidth%-%textwidth%)/%spacewidth%
%space$­­=space$­­(%numspaces%)
%curfieldval$­­=%space$­­+%curfieldval$­­
updatefield #%fieldnum%,%curfieldval$­­
'%curfieldval$­­="'"+%curfieldval$­­+"'"
'print %curfieldval$­­
show #%fieldnum%
%curfieldval$­­=field$­­(#%fieldnum%)
%curfieldval$­­=trim$­­(%curfieldval$­­)
%oldfieldval$­­=%curfieldval$­­
end if
end if
return

_wait:
t=tickspersec*w
u=ticks
do
v=ticks-u
loop v=t
return
Write to Joshua Cook   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1
--------
19/03/2005 @ 11:31
by aldweb

Anonymous

visitor
Joshua,

It does not freeze in the Palm Emulator.
It just keeps sending me a "equals nothing" message. But I can still try to erase a few more times (to make sure I really erased the last character), then once I input a new character, it does get it.
And I can still exit normally from the program whenever I want.

Did I miss something?

Cheers,

@+
aldweb
Write to aldweb   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^