PxPlus User Forum

Twitter Twitter Twitter

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Stéphane Devouard

Pages: 1 ... 5 6 [7] 8 9
91
Mike

Thanks for the answer. I know about these small tricks.

I even used this construct in my days at Explorer :
Code: [Select]
with new("data")
.'numProp = 123
.'strProp = "Hi there"
someObject'someMethod(.'_OBJ)
drop object .'_OBJ
end with
We didn't have the FOR ... clauses for object housekeeping since we were stuck with V10

My point is elsewhere :
1. being able to pass an unnamed/anonymous array [ "Mike", "Was", "Here" ] to a function/call/method without having to declare a Y$[] array and parse a string to fill it
2. being able to pass an unnamed/anonymous associative array [ "name" => "Mike", "eyes" => "blue" ] to a function/call/method without having to declare a Y$ JSON string and parse it
3. being able to pass an unnamed/anonymous plain old pxplus object (popo ?) to a function/call/method without having to declare a class skeleton & loading it

Basically 2 & 3 are very similar (in Javascript you can get/set an object property values either with objectRef.propertyName or objectRef["propertyName"] and so if either one was possible ("litteral" associative array or object definition), that would be cool.

As a suggestion, you could provide a standard / popo class yourself (for exemple, *obj/data.pvc or *plus/obj/data.pvc or whatever name you see fit)
Then allow a syntax such as :
Code: [Select]

someObject’someMethod(new("*obj/data" for program with Param1=123, Param2$="Hello World"))

// in someObject.pvc
function someMethod(options)
! // the anonymous object instantiated above is received with the Param1 and Param2$ property values set
enter options
! // now do something with options'Param1 and options'Param2$
end function

92
Wish List / Short-hand syntax for anonymous arrays or objects initialization
« on: September 11, 2020, 05:16:39 AM »
In PHP you can create and initialize an array with :
Code: [Select]
$myArray = [ "item", "another item", "a third item"];
You can also pass either an indexed or associative anonymous array to a function using :
Code: [Select]
myFunction([
  "key1" => "value 1",
  "key2" => "value 2"
]);

Almost same in C# :
Code: [Select]
string[] myArray = { "value", "another value" }; // declaring and initializing an array
myFunction(new[] {10, 20, 30}); // passing an anonymous array to a function

In Javascript you can create a simple object (and manipulate it with a syntax which is basically that of an associative array)
Code: [Select]
let options = {
  url: "server:port/path/to/resource",
  timeout: 5000,
};
myFunction({
  mailFrom: "me@myisp.com",
  mailTo: "you@yourisp.com",
  message: "Hello there"
}); // passing an anonymous object

Almost the same in C#
Code: [Select]
myFunction(new { TextProperty = "Some Value", NumProperty = 100 });
In summary :

You do not always need to declare a variable -- you can already pass literal string or number values to a subroutine or method in PxPlus.

It would be great if it was possible to do it with other data structures such as arrays, associative arrays and objects -- the latter could be wiped out when not needed anymore using the "FOR OBJECT/PROGRAM/..." housekeeping clauses

93
iNomads / Re: No Windows Printers Available
« on: September 09, 2020, 11:52:03 AM »
Jeff

The usual way of running reports with iNomads is to output them to PDF on the server and then let the system push the final document to the browser.

There is no such thing as opening client-side printers with *windev* or *winprt*, only the server-side configured printers are accessible to iNomads.

Not knowing what your code is doing with *windev* makes it difficult to give you an idea if this is an easy fix, but migrating from Windows Desktop to iNomads and Web Browser often means some changes in your code base

Hope this helps

94
I have been programming in ProvideX for Windows since 1998 after 10 years with TBred on SCO and AIX
I was instrumental in migrating my first employer's apps from CHUI to GUI, then migrating Explorer Software's WindX-only based ERP to the web using iNomads

I have re-skilled myself in mainstream web development and am also proficient in PHP 7, Javascript/jQuery, Java, C#, VB.Net, Android mobile development, MySQL, Postgres, MS SQL Server and MongoDB databases, and various frameworks (PHP Symfony 4, Microsoft .Net ASP MVC5 & Winforms, IONIC 4 for hybrid mobile apps, Express for NodeJS)

You can read more about me and my work with ProvideX and PxPlus on my resume and professional websites

I am looking for any type of work related to the topics above :
  • PxPlus training and consulting
  • Legacy applications conversion to Nomads & iNomads GUI
  • Legacy applications migration to SQL back-end databases
  • Web applications and Web services
  • Desktop applications

If you know of anyone who would be interested or are interested yourself, please contact me by private message here, or via email, or via my LinkedIn account.

Regards,

95
Language / Re: @(X),@(Y)
« on: June 22, 2020, 09:14:08 AM »
Gilles

@X() and @Y() do their calculation based on the channel passed to them as the 2nd parameter, or 0 (terminal) if no channel is passed
When running as cron, I guess the stdout and stderr are redirected either to /dev/null or to some other file (a log file maybe ?) which explains the issue
In any case, you should always base the @X() and @Y() calculation on the actual output channel

Regards

96
Programming / Re: Working with DLL
« on: May 14, 2020, 01:59:01 AM »
Make sure this is a real Win32 DLL
A .Net component class could also be compiled as file with a .dll extension but would not be suitable for use with the PxPlus DLL() function

97
Off Topic / Re: When designing your data base, did you use ERD's?
« on: February 14, 2020, 09:40:00 AM »
Hi Dave,

After being let go by Explorer Software at the end of 2018, I have followed a 5-months training last year followed by a 2,5 months internship. The goal was to gain skills in mainstream web development languages & frameworks (PHP, Symfony, Java, Android, Javascript/jQuery, IONIC/Angular/Typescript, MySQL, MongoDB) as well as modern software design (UML, Object Oriented multi-layered apps, Relational Database Design). I needed to find another job and since you can consider the french ProvideX market as slowly dying, it was time to move on.

Although my past experience with ProvideX allowed me to get in touch with SQL & RDBMS as well as the ProvideX implementation of the object paradigm, it was also the very first time in 30 years I was seeing Classes diagrams and E/R diagrams as well as the methods and techniques to build them.

In 1986-88 french software programming schools, you learned COBOL and GW-BASIC, using the built-in ISAM files for one, and building them yourself for the other. I also learned a bit of dBASE III+ during the second year. No SQL courses and no UML / OO design at the time.

When I joined my first employer in 1989, they were still using Tbred, I was the one who discovered ProvideX and advocated for the migration of the application. There were some attempts to migrate the ISAM files to SQL backends, but all were cancelled before being completed. The only documentation available when you started working on the software were the file layouts. Which could not be imported into the PVX Data Dictionary as the files were non-normalized and the DD did not support them back then (around 99-2000, before PVX V5).

When I joined Explorer in 2008, their SQL migration had been done for years. However I never saw any ERDs there, not even a Merise Physical Data Models.

In my experience, when you migrate ProvideX files to SQL, you only change for a different data store, and rarely enable all the power of the RDMBS engine -- I can be wrong, but I don't think after migration, people add foreign keys constraints to enforce referential integrity. Either your legacy BB application stores data forever without any archive/purge, or it does purge files but has referential integrity checks already programmed at the app level, when a user wants to remove some static data (a customer, a vendor) and the system needs to search all the transactional data (invoices, orders, etc...) to make sure the entity to delete does not exist anymore in your detail files.

BTW, I passed a final exam on January 8th. The official results are unknown yet (probably next week) but I got some not-official info from the main trainer who discussed with the examiners, and he told me not to worry about it ;-) I now have the equivalent of a BS degree in software design & development (I only had an associate degree from 1988). I am also in the process of creating a small one-person consulting & development services company to do free-lance work for the company where I did my internship (using ASP.Net MVC with C#). If you need any help with your db courses, feel free to pm me, I'll be happy to help an old fellow ProvideX programmer ;-)

98
Wish List / Re: passing parameters to a panel
« on: January 17, 2020, 10:25:17 AM »
Thomas,

You could convert your associative array to a JSON string before the PROCESS, and then convert back ARG_1$ from JSON to assoc. array in the panel pre-display routine

Regards

99
Programming / Re: add counter bubble to button image
« on: December 16, 2019, 05:44:09 AM »
Mike

Thomas will correct me if I'm wrong but I guess the visual rendering he is after is of this kind :
https://getbootstrap.com/docs/4.4/components/badge/

Or those red bubbles that appear on your email or facebook clients icons on your smartphone home page, to let you know the number of unread emails or notifications...

100
Wish List / Re: Tool on license use
« on: October 31, 2019, 07:18:23 PM »
Mike

If I am not mistaken, the PID of the current interpreter process is also stored in tcb(89).
Just wondering if it is just duplicate information, or if there are uses cases where tcb(506) is better than tcb(89) ?


101
Wish List / Re: Tool on license use
« on: October 31, 2019, 01:25:40 PM »
Thomas

This information is stored in a pxplus file keyed on the pid
IIRC it is *it.dbg/control.dat
It is automatically retrieved by the system when you use one of the TSK() un-documented functions — TSK(*PROCESS LIST) if I am not mistaken.
Would be easier if the PxPlus folks provided a Get_State routine indeed

Regards

102
Wish List / Re: Database Conversion Utility
« on: June 29, 2019, 01:09:50 PM »
Another issue that could be improved in the DCU

Setup (Windows 10 system):
  • myapp
    => folder that contains the data dictionary files, and a prefixdb prefix file
    => in the dictionary, each logical table name is associated with data/physical as the physical pathname
  • myapp\data
    => folder that contains the ProvideX data files

When using the DCU, the prefix file entry is created as DATA\PHYSICAL (since the key has the uppercase option set)

Therefore, if you do something like :

Code: [Select]
OPEN DICTIONARY
PREFIX FILE "prefixdb"
OPEN (nn) TABLE "logical"

ProvideX translates logical to data/physical (as set in the dictionary)
And thus does not find the entry in the PREFIX FILE and does not open the SQL table but rather the keyed file

Two possible solutions :
  • Either create the PREFIX FILE entry the same as in the dictionary
  • Or create 2 entries (DATA/PHYSICAL and DATA\PHYSICAL)

Thanks,

103
Wish List / Re: Database Conversion Utility
« on: June 27, 2019, 02:11:35 PM »
Len,

I second Thomas wishes.

**EDIT**
Other ones I’ve run into today :
- varchar(max) is not an allowed syntax with a MySQL database and should be replaced by text
- If you have named your primary keys in the data dictionary (such as PK_TableName), the generated primary key constraint is PK_TableName_TableName. This could probably be improved.

Regards

104
Programming / Re: Object Oriented Question
« on: June 26, 2019, 03:01:24 AM »
Jeff,

Well, the problem is that to create a separate window, you must use some NOMADS reserved variables.
https://manual.pvxplus.com/PXPLUS/NOMADS%20Graphical%20Application/Program%20Interaction/Concurrent%20Panels/Overview.htm
No problem with the %NOMAD_CONCURRENT_WDW global variable which is visible even inside an object (breaking the encapsulation OOP rule) but the other ones are "local", so if you set them inside an object's method, they won't be seen from the outside world. You could of course set the method as FUNCTION PERFORM so that it shares all its variables with the calling code, but that's also breaking the encapsulation rule, and if your intent is to learn OOP, it's not good to start by not honouring the base OOP concepts.

You could use the NOMADS object interface as explained there :
https://manual.pvxplus.com/PXPLUS/NOMADS%20Graphical%20Application/Program%20Interaction/Object-Oriented%20Programming/NOMADS%20Object.htm
But that's not an easy way to start with OOP

So, referring to prior messages in this thread :
  • Use the *obj/chart class as suggested by Mike if what you want is experiment with "consuming" an object created by others
  • If you want to experiment with writing your own classes, rather start with something relatively simple, such as replacing some of the CALLed programs used in your app with methods/function from a utility class you build

Hope this helps,

105
Programming / Re: Object Oriented Question
« on: June 25, 2019, 03:26:25 AM »
Jeffrey

My answer to you was to resolve the issue you had when testing in a separate 'DIALOGUE'() and it closed all your windows when you closed the new one. Concurrent panels will take care of that.

Now, OOP is a completely different subject.

As a starter, if you want to get your feet wet with it, I would suggest creating classes as libraries of functions for your app and replace the existing calls and performs.

Then you will start using them to represent entities in your app (customers, vendors, invoices) with their data/properties (name, address, email) and their behaviours/methods (Add(), Edit(), Delete(), Purchase(), Sell(), etc...)

Regards,

Pages: 1 ... 5 6 [7] 8 9