Author |
Topic: struct type ptr (Read 3392 times) |
|
SarmedNafi
Junior Member
member is offline


Posts: 93
|
 |
Re: struct type ptr
« Reply #40 on: Nov 23rd, 2015, 12:06pm » |
|
Alyce, Richard, Anatoly, and Pnlawrence, thank you very much.
All the best, Sarmed
|
|
Logged
|
|
|
|
joker
Global Moderator
member is offline


Gender: 
Posts: 157
|
 |
Re: struct type ptr
« Reply #41 on: Nov 23rd, 2015, 1:18pm » |
|
on Nov 23rd, 2015, 12:06pm, SarmedNafi wrote:| Alyce, Richard, Anatoly, and Pnlawrence, thank you very much. |
|
Sarmed, my FUNCTION example only shows about saving a string, and as Richard says, string saving is so inefficient ... more than 2 to 1 inefficient. So, as Richard neatly posted above, there are so many other and better reasons to use this method. I am probably going to combine both API methods, because I have several types of variables in my project's INI file.
|
| « Last Edit: Nov 23rd, 2015, 1:19pm by joker » |
Logged
|
|
|
|
SarmedNafi
Junior Member
member is offline


Posts: 93
|
 |
Re: struct type ptr
« Reply #42 on: Nov 24th, 2015, 01:53am » |
|
Yes Paul,
Thank you for the hint. Hope I wrote a correct name.
Sarmed
|
| « Last Edit: Nov 24th, 2015, 01:56am by SarmedNafi » |
Logged
|
|
|
|
SarmedNafi
Junior Member
member is offline


Posts: 93
|
 |
Re: struct type ptr
« Reply #43 on: Nov 24th, 2015, 02:20am » |
|
Quote:I'm not even allowed to read the LB Forum, let alone post there; I can't even see what guests, who have never joined, are allowed to see. |
|
I wonder, If we suppose that one day say Anatoly used Russian language and wrote some Booster or simulator for Liberty Basic. Is he going to be banned? Why Richard banned? Is that because Richards TIMER was not broken, or work better than Carls TIMER? I Just wonder? Richard fond of LB syntax which created by Carl. Is he make a crime because of that? We still all of us purchase licence for LB as necessary. Richard and his booster don't prevent us from that. Whey then??
|
| « Last Edit: Nov 24th, 2015, 02:22am by SarmedNafi » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: struct type ptr
« Reply #44 on: Nov 24th, 2015, 08:30am » |
|
on Nov 24th, 2015, 02:20am, SarmedNafi wrote:| We still all of us purchase licence for LB as necessary. Richard and his booster don't prevent us from that. |
|
There seems to be an assumption in some quarters that the existence of LBB necessarily operates against Carl's interests, for example by taking away paying customers. But that isn't always the case; I know of people who have stuck with Liberty BASIC - and therefore continue to promote and support it - solely because of LBB. If LBB had not existed they would have abandoned the language altogether because of its bugs and limitations.
Richard.
|
|
Logged
|
|
|
|
joker
Global Moderator
member is offline


Gender: 
Posts: 157
|
 |
Re: struct type ptr
« Reply #45 on: Nov 24th, 2015, 4:32pm » |
|
The following are the two functions that I ended up working with. They don't just return one key.
Your mileage may vary! :D
Code:
function WriteINIStruct(SectionName$,KeyName$,inifile$)
' Returns true (1) if nothing wrong or false (0) if a problem
'code by Richard Russell
size = len(theStruct.struct)
calldll #kernel32, "WritePrivateProfileStructA", _
SectionName$ as ptr, _ ' Section name
KeyName$ as ptr, _ ' Key name
theStruct as struct, _ ' Structure
size as ulong, _ ' Size of structure
inifile$ as ptr, ret as long
WriteINItheStruct = ret
end function
function GetINIStruct(SectionName$,KeyName$,inifile$)
' Returns true (1) if nothing wrong or false (0) if a problem
'code by Richard Russell
size = len(theStruct.struct)
calldll #kernel32, "GetPrivateProfileStructA", _
SectionName$ as ptr, _ ' Section name
KeyName$ as ptr, _ ' Key name
theStruct as struct, _ ' Structure
size as ulong, _ ' Size of structure
inifile$ as ptr, ret as long
GetINIStruct = ret
end function
|
|
Logged
|
|
|
|
|