• Welcome to SQLitening Support Forum.
 

News:

Welcome to the SQLitening support forums!

Main Menu

Recent posts

#1
Hi everyone,

I recently retired and as part of this new life transition, I will be closing the SQLitening forums and pulling back from programming in general after a brief transitional period as outlined below:

April 14 to April 30, 2024: No changes.

May 1, 2024: The forum will become read only disallowing new posts and no new member registrations.

May 31, 2024: The forum will be removed.

Additionally, I will not be answering programming questions via email.

If there is anything on this forum that you would like to archive for your own purposes then it is imperative that you do so before May 31, 2024.

Thanks,
Paul Squires
#2
Hi everyone,

I recently retired and as part of this new life transition, I will be closing the SQLitening forums and pulling back from programming in general after a brief transitional period as outlined below:

April 14 to April 30, 2024: No changes.

May 1, 2024: The forum will become read only disallowing new posts and no new member registrations.

May 31, 2024: The forum will be removed.

Additionally, I will not be answering programming questions via email.

If there is anything on this forum that you would like to archive for your own purposes then it is imperative that you do so before May 31, 2024.

Thanks,
Paul Squires
#3
General Board / I am retired - SQLItening foru...
Last post by Paul Squires - April 14, 2024, 04:04:20 PM
Hi everyone,

I recently retired and as part of this new life transition, I will be closing the SQLitening forums and pulling back from programming in general after a brief transitional period as outlined below:

April 14 to April 30, 2024: No changes.

May 1, 2024: The forum will become read only disallowing new posts and no new member registrations.

May 31, 2024: The forum will be removed.

Additionally, I will not be answering programming questions via email.

If there is anything on this forum that you would like to archive for your own purposes then it is imperative that you do so before May 31, 2024.

Thanks,
Paul Squires
#4
Hi everyone,

I recently retired and as part of this new life transition, I will be closing the SQLitening forums and pulling back from programming in general after a brief transitional period as outlined below:

April 14 to April 30, 2024: No changes.

May 1, 2024: The forum will become read only disallowing new posts and no new member registrations.

May 31, 2024: The forum will be removed.

Additionally, I will not be answering programming questions via email.

If there is anything on this forum that you would like to archive for your own purposes then it is imperative that you do so before May 31, 2024.

Thanks,
Paul Squires
#5
General Board / slBuildBindDat Replacements
Last post by cj - March 18, 2024, 03:33:47 PM
Optimizing insert statements using binding discovered PowerBASIC could run of out stack space around 256K using CHR$ statement.

FUNCTION binds(s AS STRING) AS STRING
 LOCAL sb AS ISTRINGBUILDERA
 sb = CLASS "StringBuilderA"
 sb.add MKDWD$(LEN(s)+1)
 sb.add "T"
 sb.add s
 FUNCTION = sb.string
END FUNCTION

FUNCTION bindb(s AS STRING) AS STRING
 LOCAL sb AS ISTRINGBUILDERA
 sb = CLASS "StringBuilderA"
 sb.add MKDWD$(LEN(s)+1)
 sb.add "B"
 sb.add s
 FUNCTION = sb.string
END FUNCTION

FUNCTION PBMAIN AS LONG
 LOCAL s,sbind AS STRING
 s = STRING$(300000,"A")
 sbind = binds(s)
 sbind = bindb(s)
 'sbind = CHR$( MKDWD$(LEN(s)+1), "T", s ) 'crash around 258729 bytes
 ? "Have a crash-free day"
END FUNCTION         

#7
You've got Questions? We've got Answers! / Re: How to be able to see if a...
Last post by cj - January 01, 2024, 03:33:43 PM
Here is a fix for slSetRelNameLocks  (requires using server)
https://sqlitening.planetsquires.com/index.php?topic=9440.msg25473
#8
You've got Questions? We've got Answers! / Re: How to be able to see if a...
Last post by cj - January 01, 2024, 03:19:38 PM
slSetRelNamedLocks  does not work without SQLitening server and has some problems.
These functions fix that problem and are easy to use.

#INCLUDE ONCE "sqlitening.inc"

FUNCTION PBMAIN AS LONG

slconnect "192.168.0.2"
slOpen    ":memory:"
slexe    "create table t1(c1)"

IF slLock  ("A") THEN IF sllock  ("Z") THEN ? "Locked A,Z"
? slGetLockNames
IF slUnlock("A") THEN IF slUnlock("Z") THEN ? "Unlock A,Z"

END FUNCTION
'=========================================================
FUNCTION slGetLockNames AS STRING
'connect and open database before call
LOCAL s1,s2 AS STRING, x AS LONG
s1 = slGetStatus(1)
IF LEN(s1) = 0 THEN EXIT FUNCTION
REPLACE $VT WITH "," IN s1
REPLACE $BS WITH "," IN s1
FOR x = 2 TO PARSECOUNT(s1) STEP 8
  s2 = s2 + PARSE$(s1,x) + ","
NEXT
FUNCTION = s2
END FUNCTION
'=========================================================
FUNCTION slIsLock(sId AS STRING) AS LONG
LOCAL Found  AS LONG 'Return 1 on success
LOCAL s      AS STRING
s = slGetLockNames
IF INSTR(s,sID + ",") THEN
  FUNCTION = 1
END IF
END FUNCTION
'=========================================================
FUNCTION slLock(sId AS STRING) AS LONG
LOCAL Found  AS LONG 'Return 1 on success
LOCAL s      AS STRING
s = slGetLockNames
IF INSTR(s,sID + ",") THEN Found = 1
IF Found = 0 THEN    'not found
  slSetRelNamedLocks "+" + sID,"T10000 E0"
  IF slGetErrorNumber = 0 THEN FUNCTION = 1
END IF
END FUNCTION
'=========================================================
FUNCTION slUnlock(sId AS STRING) AS LONG
LOCAL Found  AS LONG  'Return 1 on success
LOCAL s      AS STRING
s = slGetLockNames
IF INSTR(s,sID + ",") THEN Found = 1
IF Found = 1 THEN    'must be found
  slSetRelNamedLocks "-" + sID,"T10000 E0"
  IF slGetErrorNumber = 0 THEN FUNCTION = 1
END IF
END FUNCTION'

#9
You've got Questions? We've got Answers! / Re: How to be able to see if a...
Last post by Fim - January 01, 2024, 12:38:47 PM
"IF slLock("fim") THEN
ELSE
slUnlock("fim")
END IF"

No,I am using OPEN LOCK_FIL_NAMN FOR OUTPUT AS #TEST_LOCK_FIL
#10
You've got Questions? We've got Answers! / Re: How to be able to see if a...
Last post by cj - January 01, 2024, 12:24:47 PM
Are you using slConnect (which is required?)

IF slUnLock("fim") THEN
   sllock("fim")
END IF