Menu

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.

Show posts Menu

Messages - Mike Hatfield

#1
Nomads / Re: SELECTING A LINE OR LINES FROM A LIST BOX
October 21, 2024, 05:12:38 PM
James,

Great explanation.
I shall try this and report back.
Thank you.
#2
Nomads / Re: SHOW CONTROL
October 21, 2024, 04:25:21 PM
Thank you everybody for the help and comments.

Four days of frustration could have been avoided if the documentation noted that SHOW/HIDE doesn't apply to Fonted Text as it does for other controls.
In fact, from what I'm reading in these replies the documentation should be amended to recommend that Fonted Text not even be used as it's historic and retained for compatibility.
#3
Nomads / Re: SHOW CONTROL
October 19, 2024, 07:01:17 PM
MARTIN - Header has suppress.val checked.

I think you are right SHOW does not work with FONTEWD TEXT
Jean - I have finally got the SHOW to work with MULTI_LINE as you suggested.
HOWEVER, I had to move the directive from the initial section of the program to where the List Box is loaded.
I initially thought I could ECEUTE the code in the HEADER at POST-DiSPLaY but that didnt work either.
Now that I have changed to MULTI-LINE POST-Display works
Nomads is such a confusing product.
Some good working examples would be so much more helpful.

Thanks
#4
Nomads / Re: SHOW CONTROL
October 19, 2024, 02:18:55 AM
Still doesnt work
#5
Nomads / SHOW CONTROL
October 18, 2024, 01:41:42 AM
If my panel I have a fonted text control named SELECT.TEXT with some instruction text for the user.
The attribute is "Initially Hidden"

There is an argument in the calling program ARG_4$
When it is set to "INVOICE_ENTRY" I want to SHOW the control on the panel.

I've added this line to the default program.
If ARG_4$="INVOICE_ENTRY" SHOW CONTROL SELECT.TEXT
I can't get this to work
Why Not??

THanks
#6
Nomads / Re: SELECTING A LINE OR LINES FROM A LIST BOX
October 17, 2024, 07:03:56 PM
Again thank you both.

I am now more confused.
Clearly I am misunderstanding how this process works.


I want to highlight a selection of rows which will be returned to the calling program. These rows will be highlighted with a chosen colour for identity purposes. If I click on the row again I want the row to be unselected. I only want to pass the selected (highlighted rows) back to the calling progam.

Based on your previous replies these are the only ticked atrributes:
In Atttributes I have ticked Tab Stop
In Formatted ListBox Attributes I have ticked Multiple Selection
 
In Logic
I have a default Program
I have selected Perform in "When Entry is Selected from List Box"
This points to the code label "LINE SELECTED" in the default program.

I am unable to highlight multiple lines as per Jane's reply with a chosen colour.
If I could highlight multiple rows, how are those rows captured in the Perform above?
In my current code I can't remove a selected row from my returning string.

This is my Line Selected Code

The code creates a list of the selected rows, Adds a counter at the beginning of the list and a "!" separator between the selected rows so that I can parse it in the calling program.
00740 LINE_SELECTED:
00750  IF POS(_EOM$=$020D$) \
        THEN LET XXX$=LB.CTL'VALUE$;
             IF POS(XXX$=ARG_3$(4)) \
              THEN RETURN
00760  SELECTED++;
       LET ARG_3$(1,3)=STR(SELECTED:"000");
       LET ARG_3$=ARG_3$+STR(LB.CTL'CURRENTITEM:"000")+LB.CTL'VALUE$+"!"
00770  RETURN
#7
Nomads / Re: SELECTING A LINE OR LINES FROM A LIST BOX
October 16, 2024, 09:14:25 PM
Thank you both.

Now that I can double click a row I want to leave it highlighted with a colour.
The aim is to select one or more rows from the list box and return them to the calling program for processing.
This I have achieved but I want to highlight the row(s) with a colour as it/they is/are selected.
What is the property to do this?

Thanks
#8
Nomads / SELECTING A LINE OR LINES FROM A LIST BOX
October 16, 2024, 02:26:20 AM
I want to select a line or lines from a list box containing product sales information.
The list box is PROCESSed from invoice entry.
I only want the line in the list box to be added to the output from the process on a double click.
Currently a single click selects the line.
In the Nomads panel I have put an entry in the "When Entry is Selected from the List Box" to Perform a code section in the main program.
LINE_SELECTED:
  SELECTED++;
       LET ARG_3$(1,3)=STR(SELECTED:"000");
       LET ARG_3$=ARG_3$+LB.CTL'VALUE$+"!"

This works perfectly in sending the value of ARG_3$ back to the invoice program.
However, I don't want to select a line just by pointing the mouse and highlighting it.

I hope this makes sense.
Thanks
#9
Language / Re: Easiest way to create an XML file
June 03, 2024, 05:20:41 PM
Hi Mike,

I will try this irrespective of whether the object can handle the whole xml.
Thanks
#10
Language / Re: Easiest way to create an XML file
June 02, 2024, 05:19:41 PM
Hi jane

I tried it, works well however I need to create XML for a specific EDI enabled provider.
They require the name tags on each element within the node.

I used the *obj/xml to create xml with specific name tags.
This works well for small XML string creation however I suspect the XML string it will create for my purpose will be too large for a call to handle.
What is the best way to create a large XML string?
It would be great if the obj/xml had a write to file option.
Thanks
#11
Language / Easiest way to create an XML file
May 31, 2024, 01:22:48 AM
Hi All,

Is there a program or utility that can read file with a dictionary definition and Output it an XML file 
Thanks
#12
Nomads / Re: Library Query
May 29, 2024, 08:46:44 PM
Hi Jane,
Is there a reason why you chose %C and %S?
As I understand it, these two global variables are reserved and inbuilt into PxPlus and are also linked with ODBC as 'Session ID' and 'Company Code'.

We use %C and %S extensively throughout the dictionary in the file name expression for most of the application files.
EG "./comp"+%S$+"/APTR"+%C$

We set these two Globals in the application session startup, Local and WindX.
If we change the value of these in this program will it 'screw up' the normal operation of file access in the Dictionary in the current session or other sessions or separately in ODBC?

I decided not to use %C$ and %S$ just in case.

In my program I have set a variable %SEQN$=str(int(tim)*1000)
In the Dictionary the file NAME is "General Ledger Enquiry" and physical file is Expression "./WKFL"+%SEQN$
01010  CLOSE (8);
       LET FILECHAN=8;
       LET %SEQN$=STR(INT(TIM*1000));
       LET WORKFILE$="WKFL"+%SEQN$
01020  ERASE WORKFILE$,ERR=1030;
       GOTO 1020
01030  CALL "*dict/dd_updt;update_physical",ERR=9700,"General Ledger Enquiry","","",ERRMSG$

The Query file name is Fixed "General Ledger Enquiry"

Now my program works.
I think including FID(0) in the workfile name was causing a mismatch between the dictionary and the query.
Once I removed FID(0) it all worked.
How nice to 'waste' 1.5 days trying to do something that intuitively you knew should work but stymied by an intenal variable.  :(
Thank you for your input.
#13
Nomads / Re: Library Query
May 29, 2024, 01:40:27 AM



Jane,
Example:
I am currently FID T001
My Dictionary definition is "General Ledger Enquiry" and the file name is expression "./WKFL"+FID(0)
When I save the definition it creates the file WKFLT001
There is no data in the file yet.
Now comes the tricky part.....
If I now create the Query GLTR_QRY whilst still on T001....
I have the choice of using the Dictionary definition name or expression.
IF, I am on the same session, IE T001 the Query maintenance 'sees' the physical file whether I define the query as physical or expression and it will pop up the query screen with no data.
IF, I run my program whilst still on T001 the program ruins and the Query runs and all is good.
IF I now start a new session on T003 my program creates the workfile WKFLT003 and fills it with data (*dict/dd_update created the file).
At the end of the data generation the program PROCESSes the query GLTR_Qry
Unfortunately the Query fails because it thinks the source data file is WKFLT001 and not WKFLT003.
It seems to me that when Query goes to the Dictionary to get the real file name, Dictionary replies with the original physical name that was created directly by the dictionary.
In other words if the Dictionary and the Query use expression for the file name the Query always fails UNLESS the Dictionary Maintenance, Query and my program are all in the same session.

In other words using expression for the file name doesn't work when part of the expression is variable - eg FID(0)
Unfortunately, you can't define a query if it can't find the file that contains the data and its dictionary.

#14
Nomads / Re: Library Query
May 28, 2024, 02:48:56 AM
Hi Stéphane
Sometimes what you think is going to be an easy exercise turns out to be impossible.
I have a generic file definition in the dictionary. I use it to create a unique named work file at runtime using *dict/dd_updt. I'm changing a text based program to modernize it with Query. In my program I want to call Nomads Query that will read/process that unique file name with the
generic dictionary definition. Seems to me there is a shortcoming in the Query options.
Being able to do this with Query would save me a massive amount of recoding time to use a regular nomads panel list boxes.
#15
Nomads / Re: Library Query
May 27, 2024, 08:59:37 PM
Hi Jane, I have already tried what you suggested. Please see attached screenshots of the dictionary definition and query definition.
My WindX session was on FID(0)="T001" in the Dictionary maintenance.
Notice that file ending in T0014, FID(0) is "T001", has been created. The number 4 being, I presume, the content of TCB(13).

This code creates the work file in the main program:
I am in WindX session where FID(0)="T003"
01031  KEYED "WKFL"+FID(0)+STR(TCB(13)),[1:1:2],[2:1:8],[3:1:8],[4:1:3],0,79
01040  OPEN (FILECHAN)"WKFL"+FID(0)+STR(TCB(13))
TCB(13) AT THIS POINT IS 0

See screenshot - query running.
Notice the WKFL" file is defined for "T003 - Correct, but the TCB(13) is 6.
I presume the TCB value is associated with the call level in the stack.

Doesn't matter how I name/define the workfile, by the time the Query wants to read it the name is different because of a random TCB(13) number.
There must be a way to do this. I don't want hundreds of temporary workfiles cluttering up the disk.