; Module/File: PbToAscii_Ptr.pb ; Function: Converts PB-String to Ascii-Pointer - Linux ; Author: Omi ; Date: Dec. 17, 2014 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- Global *gMem Procedure PbToAsciiPtr(Pb.s); converts PB-String to Ascii-String-Pointer *gMem= AllocateMemory(StringByteLength(Pb, #PB_Ascii) + 1); global Mem for string in Ascii PokeS(*gMem, Pb, -1, #PB_Ascii); converts to Ascii ProcedureReturn *gMem; Returns Pointer EndProcedure ; usage for system-calls in ascii & unicode without ImportC like ... system_(PbToAsciiPtr("beep")) ; after use, don't forget ... FreeMemory(*gMem) ; IDE Options = PureBasic 5.40 LTS (Linux - x86) ; CursorPosition = 22 ; Folding = - ; EnableUnicode ; EnableXP