• Welcome, Guest. Please login.
 
November 22, 2019, 05:08:17 pm

News:

Welcome to the SQLitening support forums!


SQLitening & RMChart

Started by Fredrick Ughimi, October 30, 2018, 07:09:24 am

Previous topic - Next topic

Fredrick Ughimi

Hello Everyone,

Has anyone here worked with SQLitening & RMChart?

I am currently looking to the possibility of creating charts from SQLitening Data.

Fredrick O. Ughimi<br /><br />fughimi@gmail.com<br />- Freedom lies in being bold -- Robert Frost, Poet

Fim

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

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
Fredrick O. Ughimi<br /><br />fughimi@gmail.com<br />- Freedom lies in being bold -- Robert Frost, Poet

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 ******


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.
Fredrick O. Ughimi<br /><br />fughimi@gmail.com<br />- Freedom lies in being bold -- Robert Frost, Poet

Fredrick Ughimi

This is verbose, limiting and not flexible, but it works.


'****** 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.
   
Fredrick O. Ughimi<br /><br />fughimi@gmail.com<br />- Freedom lies in being bold -- Robert Frost, Poet

cj

November 04, 2018, 10:39:12 pm #5 Last Edit: November 05, 2018, 10:45:22 am 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


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.

Fredrick O. Ughimi<br /><br />fughimi@gmail.com<br />- Freedom lies in being bold -- Robert Frost, Poet

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

Fredrick Ughimi

Yes. I understand the values are read into aData array.

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.
Fredrick O. Ughimi<br /><br />fughimi@gmail.com<br />- Freedom lies in being bold -- Robert Frost, Poet

Fredrick Ughimi

Hello CJ,

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

Works great! Thanks once again.
Fredrick O. Ughimi<br /><br />fughimi@gmail.com<br />- Freedom lies in being bold -- Robert Frost, Poet