Mod_Harbour and Hash Arrays

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

Mod_Harbour and Hash Arrays

Postby byron.hopp » Wed Mar 25, 2020 8:45 pm

I like to use hash variables

oHash:cAccountNo
oHash:cAccountName

I had some problems and I just wanted to check.
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Mod_Harbour and Hash Arrays

Postby Otto » Wed Mar 25, 2020 9:13 pm

Hello,
please try this sample from Chrome - code editor is not working in FIREFOX.

https://fivetechsoft.github.io/snippets/?20200228160302

In javascript you have an object.
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6338
Joined: Fri Oct 07, 2005 7:07 pm

Re: Mod_Harbour and Hash Arrays

Postby byron.hopp » Wed Mar 25, 2020 9:20 pm

Thank you, I'll try that...
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Mod_Harbour and Hash Arrays

Postby byron.hopp » Thu Mar 26, 2020 1:04 am

Can you pass this to functions in your Mod_Harbour code?
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Mod_Harbour and Hash Arrays

Postby byron.hopp » Thu Mar 26, 2020 7:40 am

Thanks for the example with the Script, I have used in other places and it is great.
As far as using Hash Arrays with Mod_Harbour:
local aH := {=>}
Function Main()
aH[ 'cTime' ] := time()
aH[ 'dDate' ] := date()
aH[ 'nAge' ] := 123
?aH[ 'cTime' ]
?aH[ 'dDate' ]
?aH[ 'nAge' ]
Return nil

This works and Time, Date, and Age show in the browser window.

However should this work:

Function Main()
local aH := {=>}
aH[ 'cTime' ] := time()
aH[ 'dDate' ] := date()
aH[ 'nAge' ] := 123
TestHash( aH )
Return nil

Function TestHash( aH )
?aH[ 'cTime' ]
?aH[ 'cDate' ]
?aH[ 'nAge' ]
Return nil

I am having a problem with this, I am running on IIS.

Thanks,
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Mod_Harbour and Hash Arrays

Postby Otto » Thu Mar 26, 2020 1:19 pm

Hello,
you have a typo:
aH[ 'dDate' ] := date()

?aH[ 'cDate' ]

Best regards
Otto

Look my blog running from xbHosts.com
http://54.37.60.40/mh_blog/page-blogMuster.prg
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6338
Joined: Fri Oct 07, 2005 7:07 pm

Re: Mod_Harbour and Hash Arrays

Postby byron.hopp » Thu Mar 26, 2020 4:29 pm

Sorry to take your time. I must of stayed up way too late last night.
I could try to blame the corona virus, I bet that won't fly.

I am now happily using hash arrays in Mod_Harbour...
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA


Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 9 guests