Function not functioning ?!

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Function not functioning ?!

Muaadh salih
Many thanks for the generous help from the list. We intend to migrate from hypercard to Rev. and port All our Language learning material to rev.
However I found the following simple funtion returns an unexpected result in Rev..

 Funtion plural count,textw
if count <>1 then put "s" after textw
if count =0 then put "no" into count
return count && tetxw

calling the funtion ,say,
answer plural (4, "car")
returns 4s ( i.e. textw  is empty) in
revolution
while  it works perfectly in HC ie, (4, cars)

did I miss anything ?
p.s I am using ver 2.6 on Xp
much appriciated your help
-----------------------
Muaash Salih
University of London
SOAS

email [hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Function not functioning ?!

Brian Yennie
>  Funtion plural count,textw
> if count <>1 then put "s" after textw
> if count =0 then put "no" into count
> return count && tetxw

Is this your actual code? It has several typos, including "tetxw" which
should be "textw" in the last line.

function plural count,textw
     if count <>1 then put "s" after textw
     if count =0 then put "no" into count
     return count && textw
end plural

Should work fine in Rev with some proofreading.

- Brian

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Function not functioning ?!

Alex Tweedly
In reply to this post by Muaadh salih
Muaadh Salih wrote:

>Many thanks for the generous help from the list. We intend to migrate from hypercard to Rev. and port All our Language learning material to rev.
>However I found the following simple funtion returns an unexpected result in Rev..
>
> Funtion plural count,textw
>if count <>1 then put "s" after textw
>if count =0 then put "no" into count
>return count && tetxw
>
>  
>
should be textw - not tetxw - in the return statement
I don't know if that's a typo from creating the email - or a typo in
creating the Rev script.
If it's the latter, then that's the solution; if the former, then I
don't know (yet).

>calling the funtion ,say,
>answer plural (4, "car")
>returns 4s ( i.e. textw  is empty) in
>revolution
>while  it works perfectly in HC ie, (4, cars)
>
>did I miss anything ?
>p.s I am using ver 2.6 on Xp
>much appriciated your help
>  
>
I hope that helped - if not, could you please cut/paste the script
directly into the email to make sure we have no typo errors to confuse
things.
Thanks,

--
Alex Tweedly       http://www.tweedly.net



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.14/48 - Release Date: 13/07/2005

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution