Verfasst: 25.10.2006 15:37
So it works.dysti hat geschrieben:Ich war richtig happy nach dem Tip mit der Funktion CharToOEM_(@text,@text)
Wenn ich einen String habe wie "Müller" und ihn ausdrucke, dann erscheint auf dem Drucker auch "Mnller".
Mit der oberen Funktion erscheint: "Müller"
This, I don't understand.dysti hat geschrieben:Hole ich den String nun aus einem ListIconGadget, dann erscheint auf dem Drucker: "M_ller"
See the example below ; getting the string from a listicon doesn't change anything ?!
Code: Alles auswählen
;{- Enumerations
;{ Windows
Global Window_0
;}
;{ Gadgets
Global ListIconGadget_0
;}
;}
Procedure OpenWindow_Window_0()
Window_0 = OpenWindow(#PB_Any, 450, 200, 400, 90, "#Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
If Window_0
If CreateGadgetList(WindowID(Window_0))
ListIconGadget_0 = ListIconGadget(#PB_Any, 8, 0, 386, 86, "Gadget_0", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
AddGadgetItem(ListIconGadget_0, -1, "ü")
EndIf
EndIf
EndProcedure
OpenWindow_Window_0()
; FROM STRING
a$ = "ü"
Debug a$
Debug Asc(a$)
CharToOEM_(@a$, @a$) ; correct ASCII for ü is 129 (see ASCII table in Purebasic.chm)
Debug a$
Debug Asc(a$)
Debug "--"
; FROM LISTICON
a$ = GetGadgetItemText(ListIconGadget_0, 0, 0)
Debug a$
Debug Asc(a$)
CharToOEM_(@a$, @a$)
Debug a$
Debug Asc(a$)
;{- Event loop
Repeat
Event = WaitWindowEvent()
Select Event
; ///////////////////
Case #PB_Event_Gadget
EventGadget = EventGadget()
EventType = EventType()
If EventGadget = ListIconGadget_0
EndIf
; //////////////////////
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = Window_0
Break
EndIf
EndSelect
ForEver
;}