Conditional coding in Fscript - undocumented options

Looking at some of the fusion installation scripts, I found some
undocumented features in Fscript that I have long wanted.
Some conditional processing at last, even if primitive.
Here they are:
1. Conditional processing
if <argument1> <operation> <argument2>
<fscript command>
endif
or
if <argument1> <operation> <argument2>
<fscript command>
else
<fscript command>
endif
The if-part that is not executed because the condition is not met is echoed
to the output device with "SKIPPED: " comments.
If ...else...endif constructions can be nested. The use of "exit" exists
Fscript, not the innermost condition.
The elements of these commands are:
(1)
<argument1> can be any string, including environment variables such as
%{forte_root}.
<operation> is either "=" (equal) or "!=" (not equal)
In this case <argument2> must be a string (or environment variable)
(2)
<argument1> can be any string, including environment variables
<operation> is "is"
<argument2> is either:
"set" - the <argument1> string is an environment variable with a
value
"unset" - the <argument1> string is not an environment variable
"file" - the <argument1> string points to an existing file
"directory" - the <argument1> string is a directory file
Note that if <argument1> is specified as %{variable}, the <argument> has the
value of the environment variable.
Suppose environment variable myVar is set to "myValue". Then:
if myVar is set <--- this environment variable exists
echo "This is true"
endif
if %{myVar} is set <--- this becomes if myValue is set and
there is no environment variable myValue
else
echo "This is false since myValue is not an environment variable but a
the value of such variable"
endif
2. Set environment variables
setenv <variablename> <stringvalue>
Sets an environment variable to the specified value
3. Output to logfiles
echo <string>
echo <string> >> <filespec>
Outputs the <string> text string to the standard output or redirects it to
the specified filespec. The ">>" is the redirection operator
4. Silence output
Commands that must be executed and must not be echoed are preceded by a "
character. This includes the if / else / endif constructions:
if FORTE_ROOT = "
echo "No Forte root defined"
setenv FAILED Yes
endif
5. Searching for a string in a file
You can inspect a file for a particular string using the SearchFile command.
This sets the environment variable STATUS to either 0 (success) or non-zero
(not found)
SearchFile <filespec> <searchstring>
SearchFile %{FORTE_ROOT}
if %{STATUS} = 0
echo "Found it"
else
echo "No such string"
endif
Some examples:
# Check if FORTE_ROOT is defined as environment variable
If FORTE_ROOT is unset
Echo "Error: FORTE_ROOT is not set"
Exit
EndIf
# Check if FORTE_ROOT is pointing to a directory
If %{FORTE_ROOT} is directory
else
echo "Not a valid directory"
exit
endif
# check if a repository exists before overwriting it by accident
if %{FORTE_ROOT}/repos/myrep.btx is file
echo "Repository file myrep already exists"
exit
endif
# See if the environment variable myrepos is set
if myrepos is set
echo "You defined environment variable myrepos = %{myrepos}"
else
echo "You did not define environment variable myrepos. Now being set to
MYOWN"
setenv myrepos MYOWN
endif
# Start logging in my own logfile
Echo "--------------------------------" >>%{FORTE_ROOT}/log/mylogfile.log
Echo %{$DATE$} >>%{FORTE_ROOT}/log/mylogfile.log
Echo "Begin Load Distribution of my application "
%{FORTE_ROOT}/log/mylogfile.log#Confirm that this is the correct version of Forte.
SearchFile %{FORTE_ROOT}/install/scripts/FORTE.VER "DEV3.0.L"
If %{STATUS} != 0
Echo "Error: Forte version is incompatible for current application."
Exit
EndIf
Theo de Klerk
Architecture & Application Integration
Professional Services
Compaq Computer Corp. - the Netherlands

I found the answer:
The variable declarations were not on the same frame as the if/then statements. I solved the problem by adding (for each variable):
var mywordGrumpy:vocabulary_Grumpy = new vocabulary_Grumpy();
var mywordIncline:vocabulary_incline = new vocabulary_incline();
var mywordOodles:vocabulary_oodles  = new vocabulary_oodles();
This solved the problem! At the time the variables were being called they had not been declared, thus they had no value, thus the error message.

Similar Messages

  • Hide / display conditionally export links and export options

    Hi all,
    Is there a way to hide / display conditionally export links in a dashboard. Also, is there a way to limit the export options to display only Export to Excel, and not all the other options such as pdf, etc.
    Thank you
    Regards,
    Laurent

    Hi Laurent,
    Regarding limiting the choices of export, you can refer to below post:
    Re: Export to only PDF,Excel, PPT
    Thanks
    Hyder

  • Undocumented Option "in.mpathd -m"

    Hi!
    The default for starting in.mpath is with the Option "-a".
    In this mode IPMP will use the Default Router for testing functionality.
    In case of heavy traffic at the router, this can lead to errors at one or all interface within the IPMP Group.
    Specially for Clusters, this behavior can cause a lot of trouble. One possibility to prevent errors on the Server site is to set the FAILURE_DETECTION_TIME to a higher Value.
    With the undocumentated Option -m instead of -a, the interfaces will try to find an answer over Multicast and not primary at the default router.
    Does anybody in this Forum has expierences with -m?
    How do I know, that other Test-Adresses within the same IPMP Group are not used for proofing network health?
    Any hints and expierences with this Option would be helpful. Thanks
    Martin

    I'm using Xtreme Music, and trying find an option for SPDIF Pass Through in the sound card. Other users with this card have a software app called Creative Audio HQ that came with the drivers for the card. The Creative Audio HQ provides the SPDIF Pass Through option; but, no one has been able to explain where to get the Audio HQ. Must I uninstall?my existing?drivers before installing any new ones, or can I simply install the newest drivers on top of the old ones?The thought of uninstalling the existing drivers scares me, as everything else works fine-- afraid of creating additional problems. Are the new drivers likely to have the Audio HQ that I'm now missing?

  • Conditional Build Tags - Default Options Missing

    Greetings,
    In RHX6 when I right-click in a topic to apply a conditional
    build tag the default options Online and Print do not appear in the
    menu; the only option is New/Multiple.
    How do I get the default options back?
    Regards,

    This sounds like that at some time in the past the default
    ones have been deleted. Just add them again from the New/Multiple
    menu item.

  • Inventorised condition in imports pricing procedure

    hi all,
    in normal domestic pricing we are making inventorised conditions with the help of accounting key NVV In the tax procedure.but in imports  how we are specifying the inventorised conditions.
    Kindly guide me .
    Regards,
    velu

    Hai,
    Create following condition types for Import Duties (Do not create any Z-condition type)
    JCDB IN:Basic Custom Duty
    JCV1 IN : CVD
    JECV IN : Ed Cess on CVD
    J1CV IN : H&SECess on CVD
    JEDB IN : Ed Cess on BCD
    JSDB IN : H&SECess on BCD
    JADC Addnl Duty of Custom
    Also check following;
    SPRO > Logistics - General > Tax on Goods Movements > India > Basic Settings > Determination of Excise Duty > Maintain Excise Defaults > Here assign following for Tax Procedure;
    CVD cond. - JCV1
    ECS cond. - JECV
    ADC cond. - JADC
    Need not to maintain condition type "J1CV" in above option since it hard-coded in standard program itself.
    Note: - JCDB, JEDB, JSDB will get loaded to Stock and JCV1, JECV, J1CV and JADC will get posted to CENVAT Accounts.
    If u want to load the CVD values into the material cost - inventorised, then maintain the material as a non cenvatable material type in J1ID - Material & Chapter ID combination.

  • Executing "if" conditions from a string

    Hello,
    I am making a webapp that reads if-statements from a local text file (MUMPS file actually). I will probably have those if statements parsed to a string, but is there any way to perhaps turn them into java code and execute them? I guess I can use string utils to make them look like java code (i.e. insert variable values), but how to I execute an 'if' condition that's in a string? The local file will change all the time, so hard-coding it is no option.
    I can turn the if statements into something like this "if (1=3 && 5=2) || (!"smstring".equals("otstring"))"
    Any help or direction would be appreciated.
    Thanks!

    Interesting. BeanShell looks neat. But aside from invoking an outside tool, there's no native way to do this. You'd have to parse it according to the rules of the grammar that the if statement conforms to, and then write java code to execute it.
    Just please tell me you're not writing a MUMPS interpreter.

  • How to use Device Profiles and Viewing Conditions Profile in Photoshop Elements 11?

    In trying to get to grips with the Colour management aspects of PSE11, I have encountered the following problems:
    Having selected "Display" a sequence of clicks (Change display settings -> Advanced settings -> Colour Management -> Colour Management tab -> Colour Management)
    gives a screen which includes the headings:
    Device Profile  and Viewing Conditions Profile.
    1. Device Profile. Besides sRGB and ARGB, the profile list includes the profiles for all of the Epson papers. (I have an Epson Stylus Photo PX810FW).
    I changed the Profile to an Epson Grayscale, this was accepted within the menu, but there are no changes from normal when I viewed the image on the Windows screen or within
    PSE11. ("normal" is sRGB or ARGB).
    I thought it worth a try to test that, if I wanted the display image to closely represent what I would get on a particular Epson paper, this may be a way to do it.(I suspected this approach because I have never
    seen it in the literature!).
    So what is the purpose of all of the paper Profiles appearing in the Display listing?
    2. The Viewing Conditions Profile has also several options. I have tried to find the criteria for choosing one rather than the other, but failed to find any information. Can anyone help? I seek general guidance
    rather than the details of the Profiles.
    As a seperate question:
    Selecting Image on the PSE11 menu across the top of the displayed image, and then Convert Colour Profile, I tried this process on an image, converting tiff to sRGB. When saved there was an extra asterisk in the saved title but in this case,
    the file was still labelled tiff and there was no change in the number of Mbs. If a conversion has taken place, how is one to know?  Does saving a tiff file as jpeg change its colour profile? When is it useful to use this feature?
    Many thanks to all responders! 

    Addressing your second question, you are confusing two different things.
    tiff is an image file format, as is jpeg, as is psd, as is png, as are dozens (if not hundreds, http://en.wikipedia.org/wiki/Image_file_formats) of other formats.
    A colour profile represents the colour characteristics of devices so that, for example, displays know how to display the colours, printers know how to print them.
    Image files MAY, but do not have to, contain colour profiles.
    For details:
    http://help.adobe.com/en_US/creativesuite/cs/using/WS52323996-D045-437d-BD45-04955E987DFB. html
    http://en.wikipedia.org/wiki/Color_management#Color_profiles
    http://en.wikipedia.org/wiki/ICC_profile
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • How do I accept the Terms and Conditions when trying to set up an Apple ID for the first time ( using my iphone)?

    I am trying to create an Apple ID by using the Itunes icon on my iphone 5s for the first time. It opens up a screen with the 54 pages of Terms and Conditions and it does not allow me to even accept the Terms and Conditions... no Accept option or place to click!
    The only option is to Send the terms and conditions via email... which also does not work...it keeps asking me to "try again"... Has someone else had this problem?

    Hello, Wyseup. 
    Thank you for visiting Apple Support Communities.
    Most likely this email address has been attempted to be setup as an Apple ID at some point.  You can reset your Apple ID password via the steps in the first article below.  If you do not have access to the email account, need assistance or are not receiving the password reset link, see the second article.
    Apple ID: If you forget your password
    http://support.apple.com/kb/ht5787
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Cheers,
    Jason H.

  • Can't view terms & conditions in app store when trying to update apps

    When trying to update my apps, I get a notification that says:
    iTunes Terms & Conditions Have Changed
    Before you can proceed you must read & accept the new Terms & Conditions
    I am given the options "Cancel" and "OK". Upon clicking "OK", however, the Terms & Conditions do not show up. Instead, I am just back at the screen that shows my available updates.
    Please note that this issue is different from other issues that say they cannot update apps because of this pop-up; their situation is that the Terms & Conditions show, and they are given an option to accept the Terms & Conditions, but upon doing so and trying to update the apps again, they are prompted with the same message. I am completely unable to view the Terms & Conditions entirely.
    This may or may not have to do with another minor issue I'd been experiencing where certain applications do not allow me to switch to or from the application. For example, whenever I receive a text notification pop-up, clicking "View" or "Reply" will simply close the window but it will remain on the window that I am currently on and will not switch to the text messaging app. This also seems to be the case when a notification occurs in the notification center and upon clicking on the notification, nothing happens. This only happens to select applications, not all of them.
    I am currently running on iOS 6.1.3 on a 16GB iPhone 5 with Verizon Wireless as my provider.

    I agree with you. I have just encountered the exact same problem and it's frustrating. It's a bug.
    Opening iTunes didn't solve the issue in my case.
    Here's a description of the problem and the solution I found:
    Problem
    1. Opened the App store
    2. Logged into my account
    3. Clicked on the download link for the app in question — was presented with the dialogue that I should accept the terms and conditions etc — and pressed OK.
    4. Nothing happens. Repeated step 3 many times but nothing happened.
    Solution
    1. Quit App store
    2. Launch App store again and repeat step 3 above.
    3. The terms and conditions will appear on the screen for you to accept and you can then proceed with your download/purchase.

  • Change header pricing condition in sales order

    Hi,
    I have an requirement in VA01 and VA02 to automatically edit one header pricing condition. The user can able to change the value of that condition type in header not in items . Does anyone know what user exit I can use for this requirement.
    Thanks

    Hi Sunil,
    Plealse find below 2 methods to change header pricing conditions in sales order.
    1.Goto SE38, give prog name as MV45AFZZ and in that write logic under USEREXIT_PRICING_PREPARE_TKOMK . (OR)
    2) The same can be done by creating a Alt Calculation type routine through VOFM and writng the logic in the routine, which will then be assigned to the pricing procedure in the condition type which will automatically calculate the condition.
    Try with the options mentioned above..
    Regards,
    KK

  • Document type wise PO with display & optional purchasing group.

    Dear All,
    we have six document type from NB1 to NB6 every document type has separate no ranges, & having three field selection as Me21n, fof, NBF,
    in Spro MM Define screen layout at document level, in that we assign document type NB5 & attach field selection FOF in that purcahsing group is optional.
    same other dovcument types we assign field selection Me21n & we assign purchasing group is Display option.
    our requirement is that when i select documenyt type NB5, purchasing group will optional not in display.
    But system shows display & we cant do PO.
    Please guide me or any other config.
    Thanks
    Shital

    Hi,
    System is giving first preference to Field Selection Key ME21N, so you have to reverse the condition. 
    Maintain ME21N as optional and assign document type NB5 to it and
    For  other dovcument types Create another Field Selection Key with purchasing group as Display option and
    assign that field selection key for purchasing group is Display option.
    Regards

  • Layout Option on Selection Screen For Zreport

    Hi All,
           Plz explain how to do coding for using Layout option  on selection screen of
    report. Also i should be able to save and create new layout on selection screen.
           Thnaks in advance.
    Aniket Dayama

    hi,
    creation of sub-screens.
    selection-screen begin of tabbed block <name of the tab> for < height of the tab in no's> lines.
    eg;
    selection-screen tab(20) l1 <data element> user-comand <name of the funcion code>
    selection-screen end of block <name of the tab strip>.
    eg;
    selection-screen begin of tabbed block mytab for 10 lines.
    selection-screen tab(20) l1 user-command tab1.
    selection-screen tab (20) l2 user-command tab2..
    selection-screen end of block mytab.
    Under initialization.
    data element = text-01.
    data element = text=02.
    How to initialize the tab with default screen.
    <name of the tab> - prog = sy-repid.
    <name of the tab>- dynnr = '<subscreen no>'.
    <nane of the tab>-activetab = '<user-command for the strip>
    if this has solved ur problem then dont forget to reward with points.
    with regards,
    madhuri.

  • Condition editor in receiver determination does not show payload fields

    Hi !
    We are trying to create some conditions for the receiver determination in a RFC->XI->File scenario, but when we open the condition editor, under the XPATH option we do not set any payload fields to create conditions!!
    Any clues?
    Thanks,
    Matias.

    Hi,
    Check in SLD if your software component is installed on your business system and then clear SLD cache in ID.
    You will see interfaces assigned to your business system and also the payload fields in condition editor
    Thanks,
    Beena

  • My traffic conditions dont show up on the notification even when it is turned on - ios 8

    my traffic conditions dont show up on the notification even when it is turned on - ios 8
    I have tried hard resetting. I had a similar problem with the weather but got that resolved now. Any ideas on how to fix?
    Thanks

    I'm having the same problem on my iPhone 5s. Traffic conditions are not even a option under edit, but weirdly my wifi iPad Mini Retina shows traffic conditions. I feel like I'm missing some option, but I can't figure out what it could be.

  • My traffic conditions dont show up on the notification center even when it is turned on - ios 8

    my traffic conditions dont show up on the notification center even when it is turned on - ios 8
    I have tried hard resetting. I had a similar problem with the weather but got that resolved now. Any ideas on how to fix?
    Thanks

    I'm having the same problem on my iPhone 5s. Traffic conditions are not even a option under edit, but weirdly my wifi iPad Mini Retina shows traffic conditions. I feel like I'm missing some option, but I can't figure out what it could be.

Maybe you are looking for

  • Get Error message R6043, how do I resolve this issue with Itunes

    I got the update message and I usually immediately download and install the update, but this day I ignored the message.  A few days later I got this POP Up stating that a C++ runtime Microsoft Visual app is attempting to load a program in the wrong p

  • Upgrading RAM in the somewhat anomalous1.33 Ghz Mac Mini

    I have a 1.33 Ghz G4 Mac Mini that came with 512 MB RAM, and I'd like to upgrade the RAM to 1 GB. I haven't found any websites that specifically list this model of Mac Mini in their "find the RAM for your computer" search engines. According to my Sys

  • Dynamically adding a repeating subform is not working in Guided Procedures

    Hi, I created an Adobe XML form file (.xdp) with a button and a subform. In the button click event I wrote javascipt to add a new subform. This is working fine from the PDF preview with in the Adobe Live Cycle Designer.  Then I used this template in

  • IDOC-Acknowledgement for Scenario  IDOC_Sender to 3rd Party Filereceiver

    Hello, We have the following async scenario: SAP-ISU (BS_OU9_300)=> IDOC-SenderAdapter => FileReceiverAdapter (BSV_EDSN). We would like to receive an Acknowledgment (ALEAUDIT) back from XI to SAP-ISU (BS_OU9_300) when the fileadapter has written the

  • NOKIA X3 front buttons not working

    Hello. Today my NOKIA x3's front buttons stopped working. They're just not responding no matter how much / hard I push them. But the thing is , that I think its a software's problem. Cos the on/off button works fine when turning on / off the phone (