AutoHotkey Community

It is currently May 26th, 2012, 3:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: March 16th, 2009, 1:17 am 
Assistance please. I am obviously using MsgBox wrong, but i am trying to display the Unicode//Higher Ascii characters for Up arrow, and Down arrow in a message box. And it's not working. Here is what's failed so-far.

(Keep in mind All my AHK scripts are in standard Txt format (ANSI) and i can not simply copy and paste a ↑ or ↓ symbol into the script. )

Code:
#+/::
asc0 = {ASC 08593}
asc1 = {ASC 08595}

MsgBox, 32,CBM.ahk,Keys:`n  [Win]+[ %asc0% ] - Previous Clip`n  [Win]+[ %asc1% ] - Next Clip
;FAILED to display [ ↑ ] or [ ↓ ]

MsgBox, 32,CBM.ahk,Keys:`n  [Win]+[{ASC 08593}] - Previous Clip`n  [Win]+[{ASC 08595}] - Next Clip
;FAILED to display [ ↑ ] or [ ↓ ]

MsgBox % "Keys:`n  [Win]+[". {ASC 8593} ."] - Previous Clip`n  [Win]+[". {ASC 8595} ."] - Next Clip`n
;FAILED to display [ ↑ ] or [ ↓ ]

return


Examples are welcome.
-tbe


Report this post
Top
  
Reply with quote  
 Post subject: Bump
PostPosted: March 16th, 2009, 8:18 pm 
Bumped, due to lack of replies, and falling off the bottom of first page as a recent topic. :P


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2009, 8:31 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
Code:
asc0 = {ASC 08593}
asc1 = {ASC 08595}
Should be
Code:
asc0 := Char(08593)
asc1 := Char(08595)


That might fix it but im not sure. I don't this ASCII goes that high.

Edit: Did you mean hex values?
Code:
asc0 := Char(0x08593)
asc1 := Char(0x08595)

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2009, 11:26 pm 
you don't need to use unicode to show upwards or downwards arrow.

Code:
msgbox % Chr(24) ; upwards arrow
msgbox % Chr(25) ; downwards arrow, seems problematic


ASCII and Extended table:
Image
Image


Report this post
Top
  
Reply with quote  
 Post subject: THANK YOU!
PostPosted: March 17th, 2009, 1:26 am 
<3 ♥ <3 ♥ <3 ♥ <3 ♥ <3 ♥ <3 ♥ <3<3 ♥ <3 ♥ <3 ♥ <3 ♥ <3 ♥ <3 ♥ <3

This is a very useful reply! and i had totally missed the Chr() command! This is exactly what i was looking for. Your the tops! *^-^*

HEART!
-tbe *^u^*

<3 ♥ <3 ♥ <3 ♥ <3 ♥ <3 ♥ <3 ♥ <3<3 ♥ <3 ♥ <3 ♥ <3 ♥ <3 ♥ <3 ♥ <3


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 24th, 2009, 4:18 pm 
Offline

Joined: September 19th, 2005, 1:31 am
Posts: 115
I've spent about 2 hours scouring all the posts dealing with Unicode, Unicode2Ansi(), etc.

All I want to do is display some Greek characters in a message box and Gui :roll:

Seems like there have been may requests for this seeminly simple funciton, but no easy answers.

Here's my best attempt:
Code:
wString := "α" ; greek text to be displayed in message box or GUI

DisplayText := Unicode2Ansi(wString, sString)   ; sString *SHOULD* (I asssume?) be the output (return) value form the funtion

; Greate Gui
Gui, Add, Text, +Center vDisplayText, Text
GuiControl,, DisplayText, %DisplayText%         ; display α character in GUI
Gui, Show, x800 y300 h50 w100, New GUI Window

Msgbox, Unicode Text: %DisplayText%             ; display α character in Msgbox.

Return

Unicode2Ansi(ByRef wString, ByRef sString, CP = 0) ; Code lifted fom the Unicode2Ansi conversion posts
{
     nSize := DllCall("WideCharToMultiByte"
      , "Uint", CP
      , "Uint", 0
      , "Uint", &wString
      , "int",  -1
      , "Uint", 0
      , "int",  0
      , "Uint", 0
      , "Uint", 0)

   VarSetCapacity(sString, nSize)

   DllCall("WideCharToMultiByte"
      , "Uint", CP
      , "Uint", 0
      , "Uint", &wString
      , "int",  -1
      , "str",  sString
      , "int",  nSize
      , "Uint", 0
      , "Uint", 0)
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 26th, 2009, 2:14 pm 
Offline

Joined: September 19th, 2005, 1:31 am
Posts: 115
bumpity... :wink:


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group