IonicWind Software

Creative Basic => GUI Programs => Topic started by: GWS on March 17, 2013, 10:22:43 AM

Title: An ASCII / HEX table
Post by: GWS on March 17, 2013, 10:22:43 AM
Hi,

Here's a little program showing a table of Ascii characters, their Ascii codes and the corresponding Hex values.

You can select which value you're are interested in, and when you click on the character in the left column, it will be copied to the clipboard.  You can then paste the character at the current cursor position (or its Ascii or Hex value if you chose one of those using the buttons at the bottom).

You can paste the values into your code or some other program like Word  :)

I haven't activated Form Feed (FF) since I don't think this is used much these days .. you can easily add it or any other control characters if you wish. 

There seem to be many sets of Ascii extended characters listed on the internet - I've used a set I thought might prove most useful in text or source code.  Some characters used in other implementations I've seen will not always print or display reliably.

all the best, :)

Graham
Title: Re: An ASCII / HEX table
Post by: Brian on March 17, 2013, 01:09:33 PM
Thanks for that one, Graham, very handy

I've converted it to IWB, and put in a Fletchie Special API call to SendToClipboard, instead of using
the hidden richtext

Brian
Title: Re: An ASCII / HEX table
Post by: GWS on March 17, 2013, 08:04:38 PM
That sounds good Brian ..  :) .. I'm all for simplification.

Are you going to post it in the IWB section ?  I'd like to see how Fletchie did that ..  ;D

If it's super-slick, I'll do a revised version ..

best wishes, :)

Graham

Title: Re: An ASCII / HEX table
Post by: GWS on March 18, 2013, 02:52:56 AM
I've changed the size of the Dialog by a couple of pixels - I'd noticed the LV horizontal scrollbar had reappeared following a last minute change ..  ::)  It's gone again now ..  :)

Graham
Title: Re: An ASCII / HEX table
Post by: Brian on March 18, 2013, 09:27:08 AM
Sorry, Graham, it's not super-slick - it's just like your offering!

Probably be tomorrow, out tonight babysitting...

Brian
Title: Re: An ASCII / HEX table
Post by: Brian on March 18, 2013, 01:37:05 PM
Got let off the babysitting - having to spend the night all by myself (oh no!)

But it gives you the time to do more interesting things, like finishing off Graham's Ascii Chart...

File attached for IWB - appears to work OK. Dispenses with the hidden richedit control, and
uses the API to send the character(s) to clipboard, using Fletchie's ctl.inc

Brian
Title: Re: An ASCII / HEX table
Post by: GWS on March 18, 2013, 05:55:09 PM
Thanks Brian .. it does work with a few snags ..  :) .. it needs ctl.inc and ctl.lib in order to work.
I've never been a fan of including large libraries when I only need one or two functions in a particular program.

The line: $include "ctl.inc", covers a huge set of routines that Fletchie worked on.

In there somewhere is the function SendToClipBoard() .. and it's usage involved this sort of thing ..


DECLARE "kernel32",GlobalAlloc(flags:INT,bytes:INT),INT
DECLARE "kernel32",GlobalLock(handle:INT),INT
DECLARE "kernel32",GlobalUnlock(handle:INT),INT
DECLARE "kernel32",RtlMoveMemory(dest:INT,source:STRING,length:INT),INT
DECLARE "user32",OpenClipboard(hwnd:WINDOW),INT
DECLARE "user32",EmptyClipboard(),INT
DECLARE "user32",SetClipboardData(format:INT,handle:INT),INT
DECLARE "user32",CloseClipboard(),INT

....

sub SendToClipBoard(text:string)

DEF handle,lock:INT
     handle = GlobalAlloc(@GHND,255)
     lock = GlobalLock(handle)
     RtlMoveMemory(lock,text,len(text)+1)
     GlobalUnlock(handle)
     OpenClipboard(w1)
     EmptyClipboard()
     SetClipboardData(@CF_OEMTEXT,handle)
     CloseClipboard()
return



As you can see, it's not easy stuff ..  :o

So in this case, I think maybe the Rich Edit control is perhaps simpler to use. :)

I also notice you have the same strange effect that I got in IWB, with the 'Char' button retaining focus all the time  .. I've no idea why that is.

all the best, :)

Graham

Title: Re: An ASCII / HEX table
Post by: Brian on March 19, 2013, 02:59:24 AM
Graham,
As far as I am aware, when you include something like "ctl.inc" only the functions you need
for your selected call to work are included at compile time, not the whole library
Brian