How to create a custom library?
How to create a custom library?
Is it possible to create my own PB library with compiler functions?
macOS Catalina 10.15.7
Re: How to create a custom library?
➽ Windows 11 64-bit - PB 6.0 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti
Sorry for my bad english and the Dunning–Kruger effect.
Re: How to create a custom library?
An error in the main code. GitHub updated.
➽ Windows 11 64-bit - PB 6.0 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti
Sorry for my bad english and the Dunning–Kruger effect.
- Zebuddi123
- Enthusiast
- Posts: 794
- Joined: Wed Feb 01, 2012 3:30 pm
- Location: Nottinghamshire UK
- Contact:
Re: How to create a custom library?
Thank you falsam. You have just made my weekend interesting.
Dont forget new user`s ProcedureDLL is required
Zebuddi.
Dont forget new user`s ProcedureDLL is required
Zebuddi.
malleo, caput, bang. Ego, comprehendunt in tempore
Re: How to create a custom library?
Thanks for this tip.
But on OSX LibraryMaker does not exist. Can I make a library on Windows and use this on OSX?
I made a test, building a simple library on windows for OSX is not possible. :-/
Also this function can not be used to define a constant.
But on OSX LibraryMaker does not exist. Can I make a library on Windows and use this on OSX?
I made a test, building a simple library on windows for OSX is not possible. :-/
Also this function can not be used to define a constant.
macOS Catalina 10.15.7
Re: How to create a custom library?
To define constants, structures and macros you have to create "resident" - files with the /RESIDENT switch.
Here is my little "Resident Maker" as an IDE Tool... I think it's crossplatform, if you change the switch / to -- .
Here is my little "Resident Maker" as an IDE Tool... I think it's crossplatform, if you change the switch / to -- .
Code: Select all
;{==================================================================================
;: Name : PB Resident Maker
;: Author : George Bisonte
;: Date : July 02, 2014
;: Compiler : PureBasic 5.22 LTS (Windows - x86) - (c) 2014 Fantaisie Software
;: CompilerFlags : Debugger, XPSkin, Unicode, ThreadSafe, Usermode
;: Subsystem : none
;: TargetOS : Windows
;: License : Free
;: ---------------------------------------------------------------------------------
;}==================================================================================
;{==================================================================================
;: Configure as
;:
;: Commandline: "%FILE"
;:
;: [x] Wait until tool quits
;:
;}==================================================================================
EnableExplicit
Define.s Source, DestinationFile, PBCompiler, PBCompilerHome, Params, Output, Result
Define pc, i
Source.s = ProgramParameter()
If FileSize(Source) > 0
DestinationFile.s = GetFilePart(Source, #PB_FileSystem_NoExtension) + ".res"
PBCompiler.s = GetEnvironmentVariable("PB_TOOL_COMPILER")
PBCompilerHome.s = GetPathPart(GetEnvironmentVariable("PB_TOOL_IDE"))
Params.s = Chr(34) + Source + Chr(34) +" /RESIDENT " + Chr(34) + PBCompilerHome + "Residents\"+DestinationFile + Chr(34)
pc = RunProgram(PBCompiler, Params, "", #PB_Program_Open|#PB_Program_Read|#PB_Program_Hide)
Output.s = ""
If pc
While ProgramRunning(pc)
If AvailableProgramOutput(pc)
Result = ReadProgramString(pc) + Chr(13)
If #PB_Unicode
Result = PeekS(@Result, -1, #PB_UTF8)
EndIf
Output + Result + Chr(13)
EndIf
Wend
Output + "Exitcode: " + Str(ProgramExitCode(pc)) + Chr(13)
CloseProgram(pc)
EndIf
Else
Output = "File : '" + Source + "' not found." + Chr(13)
EndIf
MessageRequester("ResidentMaker", Output)
End
Re: How to create a custom library?
Thanks, but this does not help.
I hoped to find a comfortable way to work with asci data in a unicode program.
All the files I work with are in Asci so I can not use structures anymore to to read it or I must stop at PB 5.45.
I hoped to find a way to define a constant as asci string in a unicode project.
I hoped to find a comfortable way to work with asci data in a unicode program.
All the files I work with are in Asci so I can not use structures anymore to to read it or I must stop at PB 5.45.
I hoped to find a way to define a constant as asci string in a unicode project.
macOS Catalina 10.15.7
Re: How to create a custom library?
Why it must be a constant and cannot be a simple variable (Or list, Map etc) ?
edit : moment... cannot read anymore ? Where is there the problem ? The structures won't fit anymore ?
I work with lots of ASCII, UTF8 and Unicode files, and I don't have problems with it....
edit : moment... cannot read anymore ? Where is there the problem ? The structures won't fit anymore ?
I work with lots of ASCII, UTF8 and Unicode files, and I don't have problems with it....
Re: How to create a custom library?
Why don't you store the bytes of the ASCII strings in a DataSection with a label. You can then use CompareMemory() with the string in the buffer data you read from the file.Wolfram wrote:I hoped to find a comfortable way to work with asci data in a unicode program.
All the files I work with are in Asci so I can not use structures anymore to to read it or I must stop at PB 5.45.
I hoped to find a way to define a constant as asci string in a unicode project.
Re: How to create a custom library?
If you have ASCII files which contain pure ASCII strings, why not loading the files as ASCII and store them as UNICODE string in PB string variables. Then you can use standard string functions to work on the string data. When you are ready you can save the string data back as ASCII to the ASCII file.Wolfram wrote:Thanks, but this does not help.
I hoped to find a comfortable way to work with asci data in a unicode program.
All the files I work with are in Asci so I can not use structures anymore to to read it or I must stop at PB 5.45.
I hoped to find a way to define a constant as asci string in a unicode project.
Why? What do you want to do with such a constant?Wolfram wrote:I hoped to find a way to define a constant as asci string in a unicode project.
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
PB Last Final / Last Beta Testing
Re: How to create a custom library?
I apologize for that. I probably published this version prematurely. There were a lot of bugs in the previous version.
■ New version of MLF
Fixed many bugs.
Added German language. (Thanks to Bisonte)
Download https://github.com/MLF4PB/MLF-Alpha/archive/master.zip
■ New version of MLF
Fixed many bugs.
Added German language. (Thanks to Bisonte)
Download https://github.com/MLF4PB/MLF-Alpha/archive/master.zip
➽ Windows 11 64-bit - PB 6.0 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti
Sorry for my bad english and the Dunning–Kruger effect.
Re: How to create a custom library?
@Falsam : ouvre toi un nouveau Topic pour MLF <--- USER Library Creator
si tu veux pouvoir etre visible
(open a new Topic for MLF
if you want to be visible. )
si tu veux pouvoir etre visible
(open a new Topic for MLF
if you want to be visible. )