aldweb

Fermer I. aldweb

Fermer II. Gratuitiels PC

Fermer III. Gratuitiels Palm

Fermer IV. Partagiciels Palm

Fermer V. iziBasic Palm

Fermer VI. Connaissance Palm

Fermer VII. Ordinateur Poche

Fermer VIII. miniPortail

Spécial !



Version mobile
de l'aldweb Site

m.aldweb.com


Ni Français, ni Anglais ?

Essayez donc l'un de ces drapeaux :
[de] [es] [it] [pt]
Recherche




Météo / Spam / www

Météo Lyon


aldweb contre le SPAM


Newsletter
Pour avoir des nouvelles de ce site, inscrivez-vous à notre Newsletter.
S'abonner
Se désabonner
298 Abonnés
Sites web de la famille

Webmaster - Infos
News Amis
Visites

   visiteurs

   visiteurs en ligne

Sondage
Comment trouve-tu le nouvel habillage de l'aldweb Site ?
 
Superbe !
Joli
Moyen
Moche...
Résultats
forum.gifForum - iziBasic - Sujet n°1174

Forum - Forum
iziBasic - iziBasic


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

actif  Sujet n° 1174  Why does this code make my Palm freeze?

le 17/03/2005 @ 22:20
par Joshua Cook

Anonyme



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
Ecrire à Joshua Cook   Poster une réponse  Haut

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

Anonyme

visiteur
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
Ecrire à aldweb   Poster une réponse  Haut
actif sujet actif   clos sujet clos   Important! Important!   Nouveau Nouveau message   -   Rectifier Rectifier message   Clôturer Clôturer sujet   Remonter Remonter
[]
Catégories de discussion  Forum 



 
^ Haut ^