Source language: Translate to:

Ascii codes

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Ascii codes

Postby dpayer » Tue Mar 27, 2012 10:49 am

I have run into a similar issue as was described here:

http://www.neosoftware.com/forum/viewtopic.php?t=19274

At times it is difficult to make distinctions between strings with mixed capitalization. It would be nice to have a NB function that returned the ascii code of a character as a counterpart to having the ability to use [#13] or other ascii codes as characters represented by the variable with their ascii number.

This may be a good one for me to experiment with a VB script to address the issue but if you have time to include it as a NB function, that would be nice too. If you do ( :) ) give an option for either decimal or hex.

David P
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby Gaev » Tue Mar 27, 2012 12:44 pm

DavidP:

You could create a NeoBook Function that could be Call'ed from anywhere in your Apps.

Here is a SubRoutine version of the logic ...
Code: Select all
SetVar "[myCharacter]" "!D"
GoSub "Char2Ascii"
AlertBox "![myCharacter]" "![myAsciiCode]"


And the SubRoutine woiuld look like this ...
Code: Select all
:Char2Ascii
SetVar "[asciiCodes]" "!A032!033[#34]034#035$036 ... }125~126"

SearchStr "![myCharacter]" "![asciiCodes]" "[FoundPos]"
If "[FoundPos]" ">" "0"
   SubStr "![asciiCodes]" "1 + [FoundPos]" "3" "[myAsciiCode]"
Else
   SetVar "[myAsciiCode]" "!0"
EndIf

Return


Basically, [asciiCodes] consists of '4 characters' for 'each character whose ascii code you need'.

P.S. Note verfied by me ... so caveat emptor !!!
User avatar
Gaev
 
Posts: 3737
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby dpayer » Tue Mar 27, 2012 3:00 pm

Good idea!

David


Gaev wrote:DavidP:

You could create a NeoBook Function that could be Call'ed from anywhere in your Apps.
P.S. Note verfied by me ... so caveat emptor !!!
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests

cron