[Gambas-user] C Code character manipulation - alternatives
KhurramM
kmsuse at ...626...
Fri May 22 15:36:17 CEST 2009
I made a little bluder, my code:
================================
PUBLIC SUB Main()
' Declare AND initialize variables.
DIM count AS Integer
' The values are initialized at Zero, by above command
DIM c AS String
' READ , PRINT , AND count characters.
PRINT "Enter characters (Ctrl+D to quit): "
LINE INPUT c
PRINT c
count += Len(c)
WHILE NOT Eof ' This works excellent
'PRINT c1
LINE INPUT c
count += Len(c)
PRINT c
WEND
' PRINT the number OF characters printed.
PRINT count & " characters printed."
END
================================
Works as I require it to on CLI gnome-terminal.
It was a mis-print that EOF is not working. In my last post, every thing
works as I want it to.
Regarding Code from Ron_1st:
It has two errors:
1> WHILE (cha <> "\n") works instead of WHILE (cha <> KEY.Return)
It doesnt recognise "KEY.Return"
2> It doesnt gives me the result I need. It moves endlessly.
Ron_1st: If u think my above code needs to be re-adjusted, pls give
suggestion, but it running absolutely fine, just like its C code, above. But
your code needs more examination than that. I am still working on to run it.
Thanks for all the suggestions and help.
Best Regards
--
View this message in context: http://www.nabble.com/C-Code-character-manipulation---alternatives-tp23611042p23670597.html
Sent from the gambas-user mailing list archive at Nabble.com.
More information about the User
mailing list