SQLitening Support Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the SQLitening support forums!

Author Topic: SQLitening & RMChart  (Read 361 times)

Fredrick Ughimi

  • Master Geek
  • ****
  • Posts: 598
    • View Profile
    • Software Development Company
SQLitening & RMChart
« on: October 30, 2018, 04:39:24 AM »

Hello Everyone,

Has anyone here worked with SQLitening & RMChart?

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

Logged
Fredrick O. Ughimi

fughimi@yahoo.com
- Freedom lies in being bold -- Robert Frost, Poet

Fim

  • Guru
  • ***
  • Posts: 146
    • View Profile
    • Fims sajt
Re: SQLitening & RMChart
« Reply #1 on: November 03, 2018, 03:30:36 PM »

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

Fredrick Ughimi

  • Master Geek
  • ****
  • Posts: 598
    • View Profile
    • Software Development Company
Re: SQLitening & RMChart
« Reply #2 on: November 04, 2018, 02:26:42 PM »

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
Logged
Fredrick O. Ughimi

fughimi@yahoo.com
- Freedom lies in being bold -- Robert Frost, Poet

Fredrick Ughimi

  • Master Geek
  • ****
  • Posts: 598
    • View Profile
    • Software Development Company
Re: SQLitening & RMChart
« Reply #3 on: November 04, 2018, 02:28:13 PM »

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.
Logged
Fredrick O. Ughimi

fughimi@yahoo.com
- Freedom lies in being bold -- Robert Frost, Poet

Fredrick Ughimi

  • Master Geek
  • ****
  • Posts: 598
    • View Profile
    • Software Development Company
Re: SQLitening & RMChart
« Reply #4 on: November 04, 2018, 07:18:50 PM »

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.
   
Logged
Fredrick O. Ughimi

fughimi@yahoo.com
- Freedom lies in being bold -- Robert Frost, Poet

cj

  • Master Geek
  • ****
  • Posts: 688
    • View Profile
Re: SQLitening & RMChart
« Reply #5 on: November 04, 2018, 09:09:12 PM »

#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

« Last Edit: November 05, 2018, 09:15:22 AM by cj »
Logged
CJ

Fredrick Ughimi

  • Master Geek
  • ****
  • Posts: 598
    • View Profile
    • Software Development Company
Re: SQLitening & RMChart
« Reply #6 on: November 05, 2018, 09:03:25 AM »

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.

Logged
Fredrick O. Ughimi

fughimi@yahoo.com
- Freedom lies in being bold -- Robert Frost, Poet

cj

  • Master Geek
  • ****
  • Posts: 688
    • View Profile
Re: SQLitening & RMChart
« Reply #7 on: November 05, 2018, 09:51:28 AM »

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
Logged
CJ

Fredrick Ughimi

  • Master Geek
  • ****
  • Posts: 598
    • View Profile
    • Software Development Company
Re: SQLitening & RMChart
« Reply #8 on: November 05, 2018, 10:14:22 AM »

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.
Logged
Fredrick O. Ughimi

fughimi@yahoo.com
- Freedom lies in being bold -- Robert Frost, Poet

Fredrick Ughimi

  • Master Geek
  • ****
  • Posts: 598
    • View Profile
    • Software Development Company
Re: SQLitening & RMChart
« Reply #9 on: November 05, 2018, 01:23:47 PM »

Hello CJ,

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

Works great! Thanks once again.
Logged
Fredrick O. Ughimi

fughimi@yahoo.com
- Freedom lies in being bold -- Robert Frost, Poet