How to read a string in .pc file - proc

I am writing a program to connect the database in c++ in a file with .pcg extension. I am trying to input name (with spaces between first name and last name). I have defined the variable as char name[40]. But name variable stores only the first name and the rejects the part after the space. How to get the whole name in the name variable? I have tried "string name". I'm using g++ compiler and it's giving error.

Related

Differences between anonymous and non-anonymous hyperlinks in Sphinx

In one of my Sphinx files, I have this :
.. _pyjnius:
Pyjnius
=======
When running on Android, a version of the `Pyjnius <https://pyjnius.readthedocs.io/en/stable/>`_
library is available. This allows advanced creators to call into the Android
libraries.
It seems to compile just how I want it to, but I get a warning saying that WARNING: Duplicate explicit target name: "pyjnius". I got to this issue, advising to end the link with two underscores rather than one, and that it's called an anonymous link. It's not the exact same problem: in the issue there's two links with the same name, and in my case there's only one link, but I tried the solution and it works.
What are the differences between `this <link>`_ and `that <link>`__, aka between anonymous and non-anonymous links ? What would happen if I convert all my external hyperlinks to the double-underscore syntax ?
What are the differences between (...) between anonymous and non-anonymous link
A reference name is created when you declare a hyperlink target. But if the target is anonymous the name isn't used to match the reference to its target. The following quote from the docs sums it up:
Anonymous Hyperlinks
The reference name of the reference is not used to match the reference to its target. Instead, the order of anonymous hyperlink references and targets within the document is significant: the first anonymous reference will link to the first anonymous target. The number of anonymous hyperlink references in a document must match the number of anonymous targets.
Now the second part of the question that was embedded in the same sentence:
What are the differences between `this <link>`_ and `that <link>`__
If you read the reStructuredText specification carefully, no clear example of the concise `Title <Link>`_ syntax is given, but it's an external hyperlink target (because the URL points to the exterior of your documentation). What happens is that the Title acts as the reference name for the target, hence the verbatim error: "Duplicate explicit target name".
Making the declaration of the hyperlink target anonymous by using the double underscore __ causes Title not to be used as the target name, thus there's no longer a duplicate target name because order of declaration is used to match the anonymous target to the link.
In conclusion:
and in my case there's only one link
Yes, but what the error message is saying is that there's a "Duplicate explicit target name" the problem is that Pyjnius is declared as a target once above the section, and again explicitly as the title (acting as target name) in the link using the shortened syntax.
Also note that the reference names (the target, or title) is normalized and thus case insensitive. Thus in your example the name Pyjnius <URL> ends up being normalized to pyjnius which is the same target name above the section.
Reference Names
case is normalized (all alphabetic characters are converted to lowercase).

AS400-CRTCMD Localization. Is it possible to change language at run time?

I am actually converting all DDS files to use MSGID instead of plain text. I can now change the display language of the application just by choosing the right library with the MSGF in French, English, ...
But for the commands, it seems that CRTCMD needs a language file at compile time (with PMTFILE) and uses theses strings to generate the command. I could eventually delete the MSGF but the command will display the texts.
What I want to achieve is using the same *CMD object and be able to change the language when needed at run time.
**Edit: assuming a currently supported release, 6.1 or higher...
I think you want to use *DYNAMIC on the CRTCMD PMTFILE() parameter
*DYNAMIC
When the command is prompted, prompt text messages
will be dynamically retrieved from the message file
specified for this parameter using the message
identifiers stored in the *CMD object when the command
was created. The message identifier specified for the
PROMPT or CHOICE parameter on a CMD, PARM, QUAL, or
ELEM command definition statement must be found in the prompt text
message file when the command is being prompted.
So something like
CRTCMD CMD(MYLIB/MYCMD) PGM(MYLIB/MYPGM) SRCFILE(MYLIB/QCMDSRC)
SRCMBR(MYCMD) PMTFILE(*LIBL/MYMSGF *DYNAMIC)

How to write CHARACTER variable to file in ESQL?

I'm trying to implement simple message flow, which reads text file (SWIFT message) and replaces one field value, then I need to put it back to file.
Flow reads file as blob, then I cast message as CHARACTER and doing replacement. As result I get a CHARACTER variable, which I want write to file.
Cast the variable back to BLOB, make it the message root, then send it into a FileOutput node with default settings. Assuming that you are doing the character replacement with ESQL in a Compute node (with its Compute Mode set to change Message), then the subsequent ESQL would be:
SET OutputRoot.BLOB.BLOB = CAST(yourCharVar AS BLOB);
To write a simple CHARACTER (for example, a XML tag like '< tag >') to a file in ESQL you just have to create a compute node and add something like:
DECLARE youCharacterToWrite CHARACTER '<a simple string>';
SET OutputRoot.BLOB.BLOB = CAST(youCharacterToWrite AS BLOB CCSID InputRoot.Properties.CodedCharSetId);
And connect your compute node from out terminal to in terminal of your FileOutput to write in the file.
If you debug the variable in IIB, it will show some Base64 representation of your CHARACTER variable, but it will be correctly written to the file.

Custom Action in Deployment Project - prompt user for values, and then extract them from custom actions?

I am building a Windows Service which will be deployed on four servers. My user wants to have the service read a configuration file from a common location, and load it OnStart.
I want the installation to prompt the user for the file path and file name to the configuration file when the service is installed, and then save that data in My.Settings.
I have figured out how to set the EDITA1 and EDITA2 variables in the Deployment project's UI, so that the user will be prompted for path and file name, but I don't know how to get those values out and into the settings of the service.
Help, please.
-Jennifer
Did you try passing it to the custom action using CustomActionData Property in the Custom Action property window. syntax is /param=[EDITA1]
Context.Parameters will contain a dictionary with 1 entry key being "param" (in my example above that's the key I gave it).
I'm having a problem with passing in parameters which contain spaces. the guidelines say:
For custom actions that are installation components (ProjectInstaller
classes), the CustomActionData property takes a format of /name=value.
Multiple values must be separated by a single space: /name1=value1
/name2=value2.
If the value has a space in it, it must be surrounded by
quotes: /name="a value".
Windows Installer properties can be passed using the bracketed syntax:
/name=[PROPERTYNAME].
For Windows Installer properties such as [TARGETDIR]
that return a directory, in addition to the brackets you must include quotes
and a trailing backslash: /name="[TARGETDIR]\".
When I try the "[EDITA1]\" for the file path I need.. I get the 'FileNotFound' error for "C..\Microsoft..." while my path didn't have Microsoft

Why is GenTLB renaming symbols (appending '_')

I am using GenTLB.exe to compile a ridl file to .tlb and _TLB.pas files.
In the resulting _TLB.pas file, there are hints that it has renamed a number of symbols by appending an underscore to the end of the name.
A sample of the hints is:
// Errors:
// Hint: Symbol 'Assign' renamed to 'Assign_'
// Hint: Enum Member '_amStretch' of 'EnumVRSAppliedMaterial' changed to '_amStretch_'
// Hint: Enum Member '_amTile' of 'EnumVRSAppliedMaterial' changed to '_amTile_'
The command line I use with GenTLB is:
GenTLB -P -Pt+ <ridl file>
I get the same problem occuring if I use the tlibimp tool as well.
I am not sure, but often an underscore is appended in front of a name, if the name is conflicting with and exsisting name (e.g. reserwed word, and so).
It could be something like that.
Assign is renamed to Assign_ because of a mapping in tlibimp.sym, a INI-format text file in the same directory as tlibimp.
Another piece of logic continuously appends '_' until the name is unique with respect to prior global names tlibimp has found. All enumeration members are interpreted as globals. Are there any other instances of _amTile etc. in the generated .pas file?

Resources