Focal Point
[CLOSED] WITH in Define and Infoassist

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7987070196

January 30, 2019, 08:54 AM
jenni
[CLOSED] WITH in Define and Infoassist
Hi,

how can I create a Define in Infoassist with WITH Option??

Can't find it, but it has to werk, because after Manipulation it with Texteditor, it's still running with Infoassist.


Thanks

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.1.05
Windows, All Outputs
January 30, 2019, 12:39 PM
BabakNYC
I don't see the WITH option for DEFINE. However, editing the code doesn't always lead to not being able to open it with InfoAssist.


WebFOCUS 8206, Unix, Windows
January 30, 2019, 01:04 PM
FP Mod Chuck
Jenni

I'm not sure why they don't have that option in InfoAssist as I do see it available with App Studio. If it doesn't prevent you from opening it in the GUI again then Babak's suggestion is the only way. You can open a new feature request for that as well.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
January 30, 2019, 04:18 PM
Hallway
This is probably a stupid question, but here goes... What is the WITH option? When searching with IBI's stellar (heavy on the sarcasm) search, I get this:
quote:
No pages were found containing "with".
Wow! Not a single page in IBI's docs contain the word 'with'


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
January 30, 2019, 04:23 PM
BabakNYC
When you create a DEFINE or COMPUTE that doesn't reference any real fields you associate it with a field using WITH.


WebFOCUS 8206, Unix, Windows
January 30, 2019, 04:37 PM
Hallway
I finally found it using a Google search.

Funny how Google can find it sifting through the entire internet, but IBI search can't even find it in their own docs.


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
January 30, 2019, 04:41 PM
CoolGuy
I think Magnify Search stands for just that. Magnifies the time it takes to find something useful. Whatever dev thought that name up #nailedIt!

IBI Search button event handler:


if(userInput){
Label.Text = "Sorry, we can't find it.";
}


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
January 30, 2019, 04:45 PM
BabakNYC
https://webfocusinfocenter.inf...ang/source/dif53.htm

Search for Using Virtual Fields.


WebFOCUS 8206, Unix, Windows
January 30, 2019, 04:49 PM
CoolGuy
Oh, we found it. It's just that someone that's inexperienced, and doesn't know the keyword WITH is used in context with virtual field creation, shouldn't have to know to search for "Using Virtual Fields" to find what they need. They should be able to type "WITH" and get to where they need to.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
January 30, 2019, 04:50 PM
Hallway
quote:
When you create a DEFINE or COMPUTE that doesn't reference any real fields you associate it with a field using WITH.


So help me understand this. I get my DEFINEd and COMPUTEd fields in the code below without using WITH
 
-SET &ECHO=ALL;

SET BYDISPLAY = ON 

DEFINE FILE CAR
RANDOMFIELD/I11 = 1
END

TABLE FILE car
SUM SALES
RANDOMFIELD
COMPUTE RANDOMFIELDTOO/I11 = LAST RANDOMFIELDTOO + 1;
BY COUNTRY
BY RANDOMFIELD
BY CAR 
BY MODEL
ON TABLE RECOMPUTE
END
 



Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
January 30, 2019, 04:55 PM
Hallway
quote:
Oh, we found it. It's just that someone that's inexperienced, and doesn't know the keyword WITH is used in context with virtual field creation, shouldn't have to know to search for "Using Virtual Fields" to find what they need. They should be able to type "WITH" and get to where they need to.


Exactly. Where in Google you can type 'WebFOCUS with' and get 9 different search suggestions before you even search. Granted, they weren't perfect. It was after all the second search suggestion. Wink



Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
January 30, 2019, 05:35 PM
Hallway


Wink


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
January 31, 2019, 03:59 AM
jenni
ok, so back to my question..

You also can't create a with field with Infoassist ?

No invisible button to click or something?


WebFOCUS 8.1.05
Windows, All Outputs
January 31, 2019, 08:20 AM
BabakNYC
InfoAssist has no WITH for DEFINE or COMPUTE.


WebFOCUS 8206, Unix, Windows
January 31, 2019, 09:08 AM
Addy
When you use WITH option the value changes when the field value associated to it changes:
In the below example CNTR1 and CNTR2 has the same expression but behaves very different.
Also if you want to create just the virtual fields without using any actual table column you can use WITH

 
DEFINE FILE CAR
CNTR1/D2 WITH COUNTRY = CNTR1+1;
CNTR2/D2 = CNTR2+1;
END
TABLE FILE CAR
PRINT
CNTR1
CNTR2
MODEL
CAR
BY COUNTRY
END
 

 DEFINE FILE CAR
CNTR1/D2 WITH COUNTRY = CNTR1+1;
CNTR2/D2 = CNTR2+1;
END
TABLE FILE CAR
PRINT
CNTR1
CNTR2

END  



WF 8.2.04
Windows/Unix
All Formats
In Focus since 2006
January 31, 2019, 11:06 AM
CoolGuy
Addy, nice! *standing ovation/applause* Thank you. Smiler


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
January 31, 2019, 11:12 AM
Hallway
quote:
Originally posted by Addy:
When you use WITH option the value changes when the field value associated to it changes:
In the below example CNTR1 and CNTR2 has the same expression but behaves very different.
Also if you want to create just the virtual fields without using any actual table column you can use WITH


Now THAT is an explanation I can wrap my head around. Thank you Addy.
Good One


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
May 08, 2019, 05:29 PM
Doug
Excellent... aside from the Grunting, Groaning, and Sarcasm... Smiler

Check this out just for grins and giggles...
DEFINE FILE CAR
CNTR1/D2 WITH COUNTRY = CNTR1+1;
CNTR2/D2 = CNTR2+1;
END
TABLE FILE CAR
PRINT
-*CNTR1
CNTR2
MODEL
CAR
BY CNTR1 BY COUNTRY
END
 
-*Duplicate DEFINE isn't needed.
-*DEFINE FILE CAR
-*CNTR1/D2 WITH COUNTRY = CNTR1+1;
-*CNTR2/D2 = CNTR2+1;
-*END
TABLE FILE CAR
PRINT
CNTR1
CNTR2
END