Skip to main content
12-Amethyst
September 11, 2023
Question

The parameter ORIGIN does not work inside a program block.

  • September 11, 2023
  • 2 replies
  • 3209 views

I am using Mathcad Prime Release 9.0 and Datecode9.0.0.0

The parameter ORIGIN does not work inside a program block.

Here are the errors that I faced:
The parameter ORIGIN does not work inside a program block.

2 replies

23-Emerald IV
September 12, 2023

Please attach a worksheet that demonstrates the problem that you are experiencing.

 

Success!
Luc

JCBanks12-AmethystAuthor
12-Amethyst
September 12, 2023

Attached is the file with the reported issue.

Thanks,

Julio C. Banks

Solutions Consultant

Doing Business by the Book

e-mail: Creo_Solutions@Outlook.com

(772) 577-9744

P Please consider the environment before printing this email.

Education is a better safeguard of liberty than a standing army"

Edward Everett

.

23-Emerald IV
September 13, 2023

Attachments to your mail do (apparently) NOT make it to this forum, so I cannot see it.

Check: https://community.ptc.com/t5/Mathcad-Installation/The-parameter-ORIGIN-does-not-work-inside-a-program-block/m-p/899806#M3295

 

Success!
Luc

JCBanks12-AmethystAuthor
12-Amethyst
September 13, 2023

Luc, attached is the file showing the error when

assigning ORIGIN inside "Program blocks".

 

Notice that ORIGIN := 1 on page 1 and ORIGIN := 0

on the second page.

 

Thanks,

 

Julio Banks

23-Emerald IV
September 13, 2023

You're confusing

LucMeekes_0-1694614648099.png

with

LucMeekes_1-1694614663897.png

The first is the system variable ORIGIN, which defines the first/starting index for arrays (vectors and matrices).

The second is a(n ordinary) variable ORIGIN, which has NOTHING to do with array indexing.

If you want to define ORIGIN, you must ensure that the identifier is labelled correctly:

LucMeekes_3-1694615288575.png

 

Apart from that, you are right to observe that the statement ORIGIN <- 1 (or whatever other value) does not work (as might be expected) in a program. See this:

LucMeekes_2-1694615152411.png

Note that I use different font settings for the differently labelled items, because that makes life easier, and helps to prevent errors. My program demonstrates that even if ORIGIN is 3, I can still use index 0 for array b.

Now is this a bug? I think not. I think that changing the value of ORIGIN to various values within one sheet should not be done. In the case of your Ft calculation along b, you apparently need i to run from 1 to a value n, so it would be better programmed as:

LucMeekes_4-1694615951635.png

Finally. It seems as though you are programming a function that is (almost) readily available in Prime.

Check out pnorm():

LucMeekes_5-1694616299638.png

then

LucMeekes_6-1694616329854.png

and

LucMeekes_7-1694616345616.png

Your second function is related to the built-in qnorm():

LucMeekes_0-1694619302868.png then

LucMeekes_1-1694619310106.png

LucMeekes_2-1694619318624.png

 

Success!
Luc