Informix 4GL after field - informix

Hi I want to add an after field logic, I have 4 check boxes (check1, check2, check3 and check4). When I put a check mark on either check2, check3 and check4, I want to put check mark on check1 automatically. Any idea. Thank you.

The weakness with AFTER FIELD is that it requires you to leave the field before it is triggered.
With Genero, when we added the ON CHANGE syntax many years ago, it was implemented such that if the widget was a GUI widget such as CHECKBOX, RADIOGROUP, COMBOBOX, the ON CHANGE would be triggered when the change was made, not when the focus left the field.
We also added the UNBUFFERED input mode so that your code didn't need all those DISPLAY's scattered throughout.
You didn't state the Informix 4gl version you were using, but if you were using Four Js Genero or IBM Informix Genero (and as you said checkbox then you might be) then the answer could be ...
INPUT ... ATTRIBUTES(UNBUFFERED)
...
ON CHANGE check2
LET rec.check1 = "Y"
ON CHANGE check3
LET rec.check1 = "Y"
ON CHANGE check4
LET rec.check1 = "Y"

AFTER FIELD check2
LET rec.check1 = 'Y'
DISPLAY rec.check1 TO check1
Rinse and repeat. I'm assuming the input variables are in a record rec with names check1 through check4. The key is the double operation of assignment and display; you need both AFAICR or it doesn't 'work'. I could use DISPLAY BY NAME rec.check1 here, but I don't usually use DISPLAY BY NAME; I would probably include the screen record in the DISPLAY too. Under reasonable assumptions, though, what I wrote will probably work.

Related

How do i remove rows based on comma-separated list of values in a Power BI parameter in Power Query?

I have a list of data with a title column (among many other columns) and I have a Power BI parameter that has, for example, a value of "a,b,c". What I want to do is loop through the parameter's values and remove any rows that begin with those characters.
For example:
Title
a
b
c
d
Should become
Title
d
This comma separated list could have one value or it could have twenty. I know that I can turn the parameter into a list by using
parameterList = Text.Split(<parameter-name>,",")
but then I am unsure how to continue to use that to filter on. For one value I would just use
#"Filtered Rows" = Table.SelectRows(#"Table", each Text.StartsWith([key], <value-to-filter-on>))
but that only allows one value.
EDIT: I may have worded my original question poorly. The comma separated values in the parameterList can be any number of characters (e.g.: a,abcd,foo,bar) and I want to see if the value in [key] starts with that string of characters.
Try using List.Contains to check whether the starting character is in the parameter list.
each List.Contains(parameterList, Text.Start([key], 1)
Edit: Since you've changed the requirement, try this:
Table.SelectRows(
#"Table",
(C) => not List.AnyTrue(
List.Transform(
parameterList,
each Text.StartsWith(C[key], _)
)
)
)
For each row, this transforms the parameterList into a list of true/false values by checking if the current key starts with each text string in the list. If any are true, then List.AnyTrue returns true and we choose not to select that row.
Since you want to filter out all the values from the parameter, you can use something like:
= Table.SelectRows(#"Changed Type", each List.Contains(Parameter1,Text.Start([Title],1))=false)
Another way to do this would be to create a custom column in the table, which has the first character of title:
= Table.AddColumn(#"Changed Type", "FirstChar", each Text.Start([Title],1))
and then use this field in the filter step:
= Table.SelectRows(#"Added Custom", each List.Contains(Parameter1,[FirstChar])=false)
I tested this with a small sample set and it seems to be running fine. You can test both and see if it helps with the performance. If you are still facing performance issues, it would probably be easier if you can share the pbix file.
This seems to work fairly well:
= List.Select(Source[Title], each Text.Contains(Parameter1,Text.Start(_,1))=false)
Replace Source with the name of your table and Parameter1 with the name of your Parameter.

How can i delete the value of a column in powerbuilder?

I have a datawindow with 3 selection criteria. This selection criteria are 3 columns. If the user writes something in one of them, than he can't use the others. If he tries to do that a message aware the user that he can use only one criteria. The problem is that after he deletes or cuts what he wrote before and he tries to write something in another column, the message still pop-up. I think that the buffer still contain the last value. How can i reset it?
I guess you have to nullify the 'deleted' column. I would do it that way: in the 'ItemChanged', post:
if dwo.name = 'yourcolumn' and data = '' then
SetNull(ls_null)
post dw_selection.Setitem(row, dwo.name, ls_null)
end if
This, of course, needs to be adapted to suit your needs.
Check the "itemchanged" event of the datawindow with the returned values:
Return value
Set the return code to affect the outcome of the event:
0 (Default) Accept the data value
1 Reject the data value and do not allow focus to change
2 Reject the data value but allow the focus to change

How to change format / treat missing values in SPSS

I'm using SPSS modeler and I have a variable that the software recognizes as numeric. So the missing values are $null$. I want that the missing values of the variable are selectionable with '', as character.
So I would: or trasform the format of the variable from numeric to character or change only the missing values from $null$ to ''.
How can I fix?
thanks in advance
The best way to select null values in a numeric field is to use the #NULL() function from the Blanks and Null section of the Expression Builder.
For example, if you wanted to keep only the null values so that you could inspect them, you might use a Select node. Leave the radio button set as Include. Press the Expression Builder (calculator) button. Change the filter in the drop menu on the left side from General Functions to show Blanks and Null (press B 2 or 3 times). Double-click on #NULL(ITEM). Go to the right side and double-click on your numeric field name. Put a Table node at the end and run it.
Using Select #NULL in IBM SPSS Modeler
Another way to view just the null rows is to enter the #NULL(varname) function into the "Highlight records where" section of the Table dialog box.
"Highlight records where" dialog
When you run the table, any row that is true for this condition will be shown in red.
If you really need the variable to be a string, then use a Compute node to create a copy of this field under a new name and use the to_string() function in the Conversion section of the Expression Builder to change the type of the variable. Now you will be able to use the the Select node to grab "" as the missing value. Or you could use the Filler node to replace the column, but then you would not be able to compare before and after.
The dialog examples shown in this answer use this sample stream that is installed with your IBM SPSS Modeler software:
C:\Program Files\IBM\SPSS\Modeler\18.0\Demos\streams\featureselection.str
The easiest way to do it it's using the Fill node with the configurations:
A) FIELD
B) Condition = #NULL(#FIELD)
C) Replace by = ' '
This node will replace all $null$ for ' ' at the same variable chosen in option a.
I don't think you can customize how you visualize $nulls. (I know it's possible in SQL db though)
So I'd suggest that you work with the numbers and when you want to visualize or export the results, then turn the field to a string one then replace nulls:
Filled node > to_string(#FIELD)
Filler node > blank and nulls > #FIELD = ''

Creating an array with variables

I am relatively new to Delphi so please bear with me. Basically, I need to set variables as different values based on whether or not I am testing in an English or French translated environment. All menus in these TC scripts are accessed by their names and in French they are not the same. I can, however, access them by their position in the menu - such as [4|2].
I have a list of constants and would like to set up an array to set MenuItem1 to either File|New or [4|2] depending on the value of tcDecimalSeparator <> '.' (set as a declared constant).
Does this make sense? What would be the easiest / best way to do this?
I know I could probably set this all up with data driven testing but I don't want to rework the scripts that much prior to release.
No, your proposed solution does not make sense. First, switching based on the current decimal separator is unreliable. Second, if you already know the positions of the menu items, and they always work, regardless of the program's language, then why mess around with the English menu captions at all? Just use the menu positions all the time. (Or, if you already have something set up to select the menu text based on the language, why not also use the French menu text instead of switching between English text and French positions?)
To do what you propose, you can set up a two-dimensional array of menu identifiers:
const
TLanguage = (lEnglish, lFrench);
TUIElement = (uiFileNew, uiFileOpen, ...);
MenuIDs = array[TUIElement] of array[TLanguage] of string = (
('File|New', '[4|2]'),
('File|Open', '[4|3]')
);
Then, when you want a string, select the item that corresponds to your UI element, and then select the string for the current language:
if tcDecimalSeparator = '.' then
CurrentLang := lEnglish
else
CurrentLang := lFrench;
UseMenuItem(MenuIDs[uiFileNew, CurrentLang]);

WebBrowser Control

Please help me.
<div id="id1">$97</div>
sometimes, id1 innerHTML value is changes.
My problems is:
If this values is change, i want to do somethings. How i can know this value is changes. I using webbrowser control and c#.
I don't have access to a Vb.NET converter but this "may" work I haven't tested it....I would get the element by it's id which is id1 and then get the id1 and save it to a text file or a database, etc.
Next you would recall id again to compare it against the previous inner text. If the number has changed then the app is to messagebox you the change if not...nothing happens or you could code a message box to say something to that effect.
But either way here is the code that I could think of under a button..
Dim count As Integer = WebBrowser1.Document.GetElementById("id1").InnerText
'Here is where you would call the old value maybe run this through a loop and save the value to a text file...then pull it back up when you need to check it to compare it to the current value being shown.
If count <> count Then
MessageBox.Show("count")
End If

Resources