SQLitening Support Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the SQLitening support forums!

Pages: [1] 2 3 ... 10
 1 
 on: November 05, 2018, 01:23:47 PM 
Started by Fredrick Ughimi - Last post by Fredrick Ughimi
Hello CJ,

I mistakenly was changing the values of the same Database in another directory. My mistake.

Works great! Thanks once again.

 2 
 on: November 05, 2018, 10:14:22 AM 
Started by Fredrick Ughimi - Last post by Fredrick Ughimi
Yes. I understand the values are read into aData array.
Code: [Select]
aData(x-1) = VAL(sArray(x)) read each value into the aData array

Just that the values in my table doesn't reflect what the Chart says. Maybe I am doing something wrong. I would check.

Thanks a lot.

 3 
 on: November 05, 2018, 09:51:28 AM 
Started by Fredrick Ughimi - Last post by cj
Quote
Excellent. Thanks for the sample code. The problem is how do I individually read each values into the
aData array subscripts.
aData(0) = ? : aData(1) = ? : aData(2) = ? : aData(3) = ? : aData(4) = ?

The code did this so don't understand the question?   
aData(0) = row 1 temperature as a DOUBLE
aData(1) = row 2 temperature as a DOUBLE
aData(2) = row 3 temperature as a DOUBLE
aData(3) = row 4 temperature as a DOUBLE
aData(4) = row 5 temperature as a DOUBLE

REDIM sArray(0) AS STRING
slSelAry "select temperature from table1 LIMIT 5",sArray(),"Q9"
elements = UBOUND(sArray)
IF elements > 0 THEN
REDIM aData(elements) AS DOUBLE
 FOR x = 1 TO elements
  aData(x-1) = VAL(sArray(x)) read each value into the aData array subscript.
 NEXT
END IF

 4 
 on: November 05, 2018, 09:03:25 AM 
Started by Fredrick Ughimi - Last post by Fredrick Ughimi
Hello CJ,

Excellent. Thanks for the sample code. The problem is how do I individually read each values into the
aData array subscripts.

aData(0) = ? : aData(1) = ? : aData(2) = ? : aData(3) = ? : aData(4) = ?

Best regards.


 5 
 on: November 04, 2018, 09:09:12 PM 
Started by Fredrick Ughimi - Last post by cj
#INCLUDE "sqlitening.inc"

FUNCTION PBMAIN () AS LONG
 LOCAL x,elements AS LONG

 slOpen "junk.db3","C"
 slexe "drop table if exists table1
 slexe "create table if not exists table1(temperature integer)"
 slexe "insert into table1(temperature)values(30),(40),(70),(60),(20),(17),(88)"

 REDIM sArray(0) AS STRING
 slSelAry "select temperature from table1",sArray(),"Q9"

 'read each value into the aData array subscript.
 elements = UBOUND(sArray)
 IF elements > 0 THEN
  REDIM aData(elements) AS DOUBLE
  FOR x = 1 TO elements
   aData(x-1) = VAL(sArray(x))
  NEXT
 END IF
END FUNCTION


 6 
 on: November 04, 2018, 07:18:50 PM 
Started by Fredrick Ughimi - Last post by Fredrick Ughimi
This is verbose, limiting and not flexible, but it works.

Code: [Select]
'****** Read data values ******
    REDIM aData(4)
    LOCAL dTemperature1 AS DOUBLE
    LOCAL dTemperature2 AS DOUBLE
    LOCAL dTemperature3 AS DOUBLE
    LOCAL dTemperature4 AS DOUBLE
    LOCAL dTemperature5 AS DOUBLE
    slSEL "SELECT Temperature as ITemperature1 FROM tblObservationChart LIMIT 1"
    IF ISTRUE slGetRow() THEN
       dTemperature1 = VAL(slFN("ITemperature1"))
    END IF
    slCloseSet

    slSEL "SELECT Temperature as ITemperature2 FROM tblObservationChart LIMIT 2, 1"
    IF ISTRUE slGetRow() THEN
       dTemperature2 = VAL(slFN("ITemperature2"))
    END IF
    slCloseSet

    slSEL "SELECT Temperature as ITemperature3 FROM tblObservationChart LIMIT 3, 1"
    IF ISTRUE slGetRow() THEN
       dTemperature3 = VAL(slFN("ITemperature3"))
    END IF
    slCloseSet

    slSEL "SELECT Temperature as ITemperature4 FROM tblObservationChart LIMIT 4, 1"
    IF ISTRUE slGetRow() THEN
       dTemperature4 = VAL(slFN("ITemperature4"))
    END IF
    slCloseSet

    slSEL "SELECT Temperature as ITemperature5 FROM tblObservationChart LIMIT 5, 1"
    IF ISTRUE slGetRow() THEN
       dTemperature5 = VAL(slFN("ITemperature5"))
    END IF
    slCloseSet
    aData(0) = dTemperature1 : aData(1) = dTemperature2 : aData(2) = dTemperature3 : aData(3) = dTemperature4 : aData(4) = dTemperature5

Any better suggestions would be appreciated.

Best regards.
   

 7 
 on: November 04, 2018, 02:28:13 PM 
Started by Fredrick Ughimi - Last post by Fredrick Ughimi
Hello Everyone,

I think RMChart is pretty straight forward. Its just reading the values from SQLitening as double array that is where I am stuck.

From RMChart sample: '****** Read data values ******

Code: [Select]
REDIM aData(0) AS DOUBLE
REDIM aData(4)
aData(0) = 30 : aData(1) = 40 : aData(2) = 70 : aData(3) = 60 : aData(4) = 20

How do I translate the above, reading from SQLitening table? I have tried using slSelAry, it uses string array, but RMChart requires double array. I really stuck and I need some help.

Thank you in advance.

 8 
 on: November 04, 2018, 02:26:42 PM 
Started by Fredrick Ughimi - Last post by Fredrick Ughimi
Hello Fim,

Quote
RMchart is an excellent product, but .....
It's dead, no further development, wondering if the product's author is still alive.

RMChart is here and still being actively used other by programming platforms like XBase++
http://www.brothersoft.com/rmchart-35638.html

 9 
 on: November 03, 2018, 03:30:36 PM 
Started by Fredrick Ughimi - Last post by Fim
RMchart is an excellent product, but .....
It's dead, no further development, wondering if the product's author is still alive.
/Fim

 10 
 on: November 01, 2018, 12:58:19 PM 
Started by sbirrari - Last post by cj
Quote
How can I completely suppress every error message and let the library calls fail when there is a lock timeout?
Do I need to set the mods on every call?

slSetProcessMods "r" must be after slOpen (which you have done.)
Are you sure you need T1000 (1-second) which causes the problem and no retry?
The default of 10000 (10-seconds) works well so MSGBOX shouldn't appear.

Getting rid of the T option and the pops and pushes would be my suggestion.

Anyway, playing with this code might be useful.


#INCLUDE "sqlitening.inc"
FUNCTION PBMAIN () AS LONG
 LOCAL hThread AS LONG
 slSetProcessMods "E0"

 slopen "junk1","CT1000"  'make busy-timeout extremely small (not suggested)
 slSetProcessMods "r" 'required after slOpen so busy MSGBOX will not appear

 slexe "create table if not exists t1(c1)"
 THREAD CREATE LockDataBase(0) TO hThread
 THREAD CLOSE hThread to hThread
 SLEEP 1000 'so other thread locks before we attempt insert
 slexe "insert into t1 values('one')
 ? "Done"

END FUNCTION

THREAD FUNCTION LockDataBase(BYVAL notused AS LONG) AS LONG
 slOpen "junk1"
 slExe "begin exclusive"
 ? "transaction active",,FUNCNAME$
 slExe "end"
END FUNCTION

Pages: [1] 2 3 ... 10