Hello friends,
static h := {=>}
h['mycParts'] := {"date=1900-11-21", "time=16:00"}
// Correct loop syntax for iterating over the array in the hash
FOR EACH cTmp IN h['mycParts']
? cTmp
NEXT
But when I try to use
h["cTmp"] := ""
FOR EACH h["cTmp"]IN h['mycParts']
? h["cTmp"]
NEXT
I get a syntax error.
Is there a workaround?
Best regards,
Otto
hash for storing variables
hash for storing variables
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: hash for storing variables
It does not make sense to me. What do you want to get?
Re: hash for storing variables
Enrico, I use a patcher and preprocessor for my programming.
https://forums.fivetechsupport.com/view ... 63#p260562
Best regards,
Otto
https://forums.fivetechsupport.com/view ... 63#p260562
Best regards,
Otto
ADVANTAGES OF THE PATCHER AND PREPROCESSOR SYSTEM
The Patcher and Preprocessor system allows for the integration of components with simple instructions like
$-> DATEPICKER: id = dateInput.
This offers several benefits:
Clarity and Compactness:
The code remains clear and easy to read. Reusability: The same component can be reused in different parts of a project, simplifying maintenance. Centralized Updates: Changes to the DATEPICKER component need only be made in one place.
Separation of Structure and Logic:
The structure (HTML), style (CSS), and logic (JavaScript) of components can be edited independently. Consistency: Ensures consistent use of the date input component throughout the project.
Similarities with Object-Oriented Programming
The approach shares similarities with object-oriented programming (OOP), especially regarding modularity and encapsulation. However, it lacks classical OOP elements like inheritance and polymorphism. The use of multiple levels of patchers and preprocessors for composing components resembles the OOP principle of composition. This enhances reusability and maintainability and allows for a well-structured development of complex applications. However, it is not true OOP as the focus is more on reusing code snippets rather than creating and managing objects in the OOP sense.
Conclusion
In summary, this approach offers an efficient, modular, and component-based approach to web development. It shares many advantages of object-oriented programming, although it does not encompass all aspects of OOP. Centralizing style definitions and avoiding redundancies are important to minimize conflicts and maintenance issues.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: hash for storing variables
What is the point of using h["cTmp"] as the FOR EACH variable?
Re: hash for storing variables
Hello Enrico,
for e.g. my code looks like this.
All the moduls are this way independent.
Best regads,
Otto
for e.g. my code looks like this.
All the moduls are this way independent.
Best regads,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: hash for storing variables
I do not understand, sorry. Anyway, it still does not make sense.
Re: hash for storing variables
Enrico, the advantage is that you have reusable blocks here and don't have to worry about passing the variables.
It's simply the productivity that is the advantage.
It's a method to make the source code more readable and secure.
Best regards,
Otto
It's simply the productivity that is the advantage.
It's a method to make the source code more readable and secure.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Re: hash for storing variables
Hello friends,
Here is an example of a test program.
All these blocks are reusable in all my programs.
Best regards,
Otto
Here is an example of a test program.
All these blocks are reusable in all my programs.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************