Seite 2 von 2

Verfasst: 25.10.2006 15:37
von gnozal
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"
So it works.
dysti hat geschrieben:Hole ich den String nun aus einem ListIconGadget, dann erscheint auf dem Drucker: "M_ller"
This, I don't understand.
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
;}

Verfasst: 25.10.2006 16:35
von bobobo
dysti hat geschrieben: Hole ich den String nun aus einem ListIconGadget, dann erscheint auf dem Drucker: "M_ller"

Was muß denn jetzt noch konvertiert werden? Da kann man ja verzweifeln!
das CharToOem nur EINMAL anwenden !!
Ansonsten wird aus einem Müller ein Bäcker :)

Code: Alles auswählen

a$="Müller"
Debug a$ 
CharToOem_(@a$, @a$)
Debug A$ 
CharToOem_(@a$, @a$) 
Debug A$
Für ne Umkehrung gibt es dann OemToChar_(@a$,@a$)

Verfasst: 27.10.2006 12:16
von grapy
@gnozal

Hi,

when I use your PureLPRINT library V4 i miss the Function:

LPRINT_PrintData(*MemoryID, length)

what about that?

grettings :D grapy

Verfasst: 27.10.2006 17:22
von gnozal
grapy hat geschrieben:@gnozal

Hi,

when I use your PureLPRINT library V4 i miss the Function:

LPRINT_PrintData(*MemoryID, length)

what about that?

grettings :D grapy
Hum, it seems it got lost during the PB3.94 -> PB4.00 translation :oops:
I will have a look a this.

Verfasst: 28.10.2006 08:45
von gnozal
grapy hat geschrieben:@gnozal

Hi,

when I use your PureLPRINT library V4 i miss the Function:

LPRINT_PrintData(*MemoryID, length)

what about that?

grettings :D grapy
Should be fixed

Verfasst: 02.11.2006 08:39
von grapy
@gnozal

Thank you very much!!! Great!!! :D

:mrgreen: grapy :mrgreen:

Verfasst: 03.11.2006 22:05
von dysti
@gnozal :

Danke, super