what does "The run procedure option is not allowed with member type RPGLE" mean? - rpg

What does "The run procedure option is not allowed with member type RPGLE" mean?

what does "The run procedure option is not allowed with member type RPGLE" mean?
Apparently that is the error message identifier PDM0365 with first-level text "The Run Procedure option is not allowed with member type &1." from the Message File (MSGF) QUOMSGF in library QPDA. In the second level text [visible after F1=Help is pressed with the cursor positioned on that message id, or in Display Message Description (DSPMSGD) for that message Id and message file] what is the cause and the recovery for the error condition is further explained; i.e. the assistance requested on this site, probably could have been resolved by asking that the system should provide the Help:
Cause . . . . . : You cannot run a procedure with this type.
Recovery . . . : The following member types can be run as procedures: REXX,
OCL36, BASP, BASP38.
With the replacement text for the replacement-variable &1 being RPGLE, the indication is that the option-16="Run Procedure" was issued against a member listed in the Work With Members Using PDM (WRKMBRPDM) feature, and the TYPE for the member was RPGLE instead of one of the listed as supported member types noted in the Recovery text.
Additionally, if under the heading Opt [the USEnglish abbreviation for Option] the F1=Help were pressed [instead of] where the option 16 was typed, the following Help Text would be presented that explains what are the options that can be specified and what each of the system-supplied numeric options will effect:
Help Options - Help
16=Run procedure
Type 16 to run a source member with a member type of REXX,
OCL36, BASP, or BASP38. If you try to run a member with a type
that cannot be run, you receive an error message. To run an
OCL36 procedure, the file name must be QS36PRC. You can have
the member run in batch mode or interactively depending on what
you specified in the Run in batch prompt on the Change Defaults
display.
Therefore if a Run option is not an eligible task to perform against the member of type=RPGLE, perhaps review the other options for what they might provide. Here are two, one conspicuous by specific mention of support for the type-RPGLE in the Option help-text and another much more subtle by only an allusion to types that reflect an ILE source type [with [...] denoting snipped content from that help]:
[...]
14=Compile
Type 14 to compile one or more members. The system creates an
object based on the member being compiled. The member is
compiled interactively or in batch mode, depending on what you
have specified on the Change Defaults display.
The following member types can be compiled: [...]
PLI38, PNLGRP, PRTF, PRTF38, QRY38, RMC, RPG, RPGLE, RPG36,
RPG38, RPT, RPT36, RPT38, SPADCT, SQLC, SQLCPP, SQLCBL,
[...]
When the programming development manager compiles a program
[...]
15=Create module
Type 15 to create a module object for an ILE source type.
[...]
For the latter, to create a Module (*MOD) object versus to create a Bound Program (*PGM) from the RPGLE type which is a contraction of RPG and ILE, denoting that type as an ILE source type.
So instead of using Option-16, use either of Option-14 or Option-15 to compile the ILE RPG source into an executable [*PGM] or a linkable [*MOD] object.

Option 16 (Run procedure) only applies to REXX procedures (and maybe some others). You can't use it to run an RPG/COBOL/C program. It MIGHT work to run a CL program, but I don't think so.
To run a program, either CALL it from the command line or create your own PDM option.
The SEU error may or may not be an error - SEU hasn't been kept up-to-date with all the new features of the RPGLE language. Remember that SEU is simply a source editor/validator.
If you were able to compile the RPG program (using PDM option 14 for CRTBNDRPG or option 15 for CRTRPGMOD followed by running the CRTPGM command) then the SEU 'problem' isn't a problem at all.

Related

STM32F0 with ADC and DMA with Renode

I'm trying to run an application on Renode that uses ADC and DMA for the STM32F030F4P, I created a stm32f0.repl file with the dma and adc as follows:
dma: DMA.STM32LDMA # sysbus 0x40020000
[0] -> nvic#[9]
adc: Analog.STM32F0_ADC # sysbus 0x40012400
referenceVoltage: 3.3
externalEventFrequency: 1000
-> nvic#12
dmaChannel: 1
dmaPeripheral: dma
When I run Renode, I get the following error:
For parameter 'dmaPeripheral' of type 'Antmicro.Renode.Peripherals.DMA.IDMA' found attribute at C:\Program Files\Renode\platforms\cpus\stm32f0.repl:151:5 with value [ReferenceValue: dma]
Parameter is not assignable from the reference value, constructor rejected.
At C:\Program Files\Renode\platforms\cpus\stm32f0.repl:146:6:
adc: Analog.STM32F0_ADC # sysbus 0x40012400
^
What is the correct value for dmaPeripheral?
As it's optional, you can remove it completely. This would lead to DMA not being used.
It seems that what you have written should be doable, and it's a bug that it's not possible. The STM32LDMA should implement the IDMA interface and it doesn't.
I would suggest filing a bug on Renode's GitHub
Disclaimer: I'm one of Renode developers

Am I using TextLoader wrong when running the ML.Net Iris demo in F#?

I am new to F#/.NET and I am trying to run the F# example provided in the accepted answer of How to translate the intro ML.Net demo to F#? with the ML.NET library, using F# on Visual Studio, using Microsoft.ML (0.2.0).
When building it I get the error error FS0039: The type 'TextLoader' is not defined.
To avoid this, I added the line
open Microsoft.ML.Data
to the source.
Then, however, the line
pipeline.Add(new TextLoader<IrisData>(dataPath,separator = ","))
triggers:
error FS0033: The non-generic type 'Microsoft.ML.Data.TextLoader' does not expect any type arguments, but here is given 1 type argument(s)
Changing to:
pipeline.Add(new TextLoader(dataPath,separator = ","))
yields:
error FS0495: The object constructor 'TextLoader' has no argument or settable return property 'separator'. The required signature is TextLoader(filePath: string) : TextLoader.
Changing to:
pipeline.Add(new TextLoader(dataPath))
makes the build successful, but the code fails when running with
ArgumentOutOfRangeException: Column #1 not found in the dataset (it only has 1 columns), I assume because the comma separator is not correctly picked up (incidentally, you can find and inspect the iris dataset at https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data).
Also
pipeline.Add(new TextLoader(dataPath).CreateFrom<IrisData>(separator: ','))
won't work.
I understand that there have been changes in TextLoader recently (see e.g. https://github.com/dotnet/machinelearning/issues/332), can somebody point me to what I am doing wrong?
F# just has a bit of a different syntax that can take some getting used to. It doesn't use the new keyword to instantiate a new class and to use named parameters it uses the = instead of : that you would in C#.
So for this line in C#:
pipeline.Add(new TextLoader(dataPath).CreateFrom<IrisData>(separator: ','))
It would be this in F#:
pipeline.Add(TextLoader(dataPath).CreateFrom<IrisData>(separator=','))

Compile with standalone flag gives compilation errors in client code

I'm attempting to compile Zero29 with the --standalone compiler flag. The project itself compiles fine, but I have a unit test project that exercises some code in the Zero29 project, even though it's an executable program (.exe).
Everything works fine without the --standalone compilation flag.
However, when I add the --standalone compilation flag to the Zero29 project, the Zero29 project compiles fine, but in the unit test project, the compiler complains about this Discriminated Union defined in the Zero29 project:
namespace Ploeh.ZeroToNine
open System
open Ploeh.ZeroToNine.Versioning
type Arg =
| Assign of Version
| AssignRank of Rank * int
| Increment of Rank
| ListVersions
| ShowHelp
| Unknown of string list
The unit test project directly references the Zero29 project:
Zero29.UnitTests --references--> Zero29 (where --standalone is added)
When I attempt to compile the entire solution, the Zero29 project compiles with the --standalone flag, but then compilation of Zero29.UnitTests fails. There are several errors, but they are all the same, so here's a single example:
error FS0039: The value or constructor 'Assign' is not defined
Which points to the third line of this code:
let ParseAssignVersionReturnsCorrectResult(version : string) =
let actual = [| "-a"; version |] |> Args.Parse
verify <# [Assign(Version version)] = (actual |> Seq.toList) #>
The strange thing is that while the compiler complains about Assign in the third line of this code snippet, it doesn't complain about the use of Args.Parse, even though it's defined in the same code file as the Arg Discriminated Union.
Why does it do that, and how can I resolve this issue?
(I've attempted to distil the problem here, but the links I've provided point to the actual code files on GitHub, if more information is required.)
Libraries compiled with the --standalone switch cannot expose any F# datatypes. This is, for one, expressly stated in Pickering (2007), p. 210. In your case, a discriminated union is one of these prohibited types. The fact that the file is an executable changes nothing here: it becomes a library the moment you attempt to use it as one.
There have been also multiple reports (for example, here and here) that even libraries compiled with --standalone behave, quoting one of these sources, “funky.” It would be safe to say that the use of this switch should perhaps be limited to stand-alone executables only (and they cannot pretend to be a library even when under unit tests).
Pickering R. (2007). Foundations of F#. Apress.

Why does the compiler say "statement expected, but expression of type '<x>' found"?

I googled around and found a way to set the mouse cursor position in Delphi.
Here is my code example:
SetCursorPos(100,100);
It's simple, but not working. Delphi gives me the error
"statement expected,but expression of type 'longbool' found"
I am getting the same error with this command:
PostMessage(wb1.Handle,WM_KEYDOWN, VK_RIGHT,0);
where wb1 is my TWebBrowser component.
Any ideas?
You have probably disabled a feature called "Extended syntax", which (among other things) allows you to use function calls like procedure calls. You can re-enable this feature in the project's options dialog.

DomainTypes in XmlProvider FS0039 not defined

I am trying to use the FSharp.Data XmlProvider.
According to the samples you can access nested types and create a function that will receive a parameter of one of those types.
https://github.com/fsharp/FSharp.Data/blob/master/samples/library/XmlProvider.fsx (line 177)
However when I try to do the following:
type businessesT = XmlProvider<"Businesses.xml">
type businessT = businessesT.DomainTypes.Business
let testfunc (b:businessesT.DomainTypes.Business) =
b
It seems to work until I actually compiles and then I get
error FS0039: The type 'Business' is not defined
UPDATE:
The problem can be reproduced with the sample from FSharp.Data (XmlProvider.fsx)
adding a type alias after line 205
type Rss = XmlProvider<"http://tomasp.net/blog/rss.aspx">
type test = Rss.DomainTypes.Channel
What is strange is that the sample with the printDiv function is working...
This is most likely caused by some problem with loading the type provider - if the compiler fails to load the type provider, then it cannot run it and so none of the provided types like Business would be defined.
Are you using #r in a script file, or are you referencing the type provider through "Add References" in a project? If you're using #r, check if there is any error message on that line. In case of project, check other error messages output by the compiler.
I already listed some common reasons why type provider fails to load in another answer.
This was probably the same problem as "type provider" not recognized when building project, which has been fixed in FSharp.Data 1.1.10

Resources