Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A long list of strings
#1
I have two questions in relation to a long list of strings in one of my macros :

(a) To declare this long list of strings is it possible to use one declaration statement (str) and then continue the list in several lines? In other words is it possible to use continuation lines in QM editor?

(b) Is it possible to use a kind of fortran-like equivalence statement for this long list of strings, for example in the case you need to output their values using the elements of an ARRAY in a for-like statement than using explicitly the name of each-one of the strings.

Many thanks for any advice.
#2
1. Like this?

str a="a",
b="b",
c="c",
...

2. Yes, but without variable names.
#3
Thank you for dealing with it. Let me give an example:

(a) At present I use :
str u_itape u_ifile u_ispect u_sample u_smpby u_smpdate u_smptime u_anaby u_anadate u_anatime
str u_idet u_lab1 u_lab2 u_mcatype u_ireg u_ich u_igeo u_vlm u_decay u_samdur u_remarks
str u_acq_date u_acq_time u_acqby

Is it possible to use one str statement, instead of three?

(b) Is there a simple way (recursive list) to output the values of these strings?

Best regards.
#4
1. No. Only Ctrl+W.

2.
Macro Macro8
Code:
Select All      Help
out
str u_itape("first") u_ifile u_ispect u_sample u_smpby u_smpdate u_smptime u_anaby u_anadate u_anatime u_idet u_lab1 u_lab2 u_mcatype u_ireg u_ich u_igeo u_vlm u_decay u_samdur u_remarks u_acq_date u_acq_time u_acqby("last")

str* p
for p &u_itape &u_acqby+1 sizeof(str)
,out *p

or

Macro Macro8
Code:
Select All      Help
out
str u_itape("first") u_ifile u_ispect u_sample u_smpby u_smpdate u_smptime u_anaby u_anadate u_anatime u_idet u_lab1 u_lab2 u_mcatype u_ireg u_ich u_igeo u_vlm u_decay u_samdur u_remarks u_acq_date u_acq_time u_acqby("last")

str* p=&u_itape; int i
for i 0 (&u_acqby-p)/sizeof(str)+1
,out p[i]
#5
(1) Could you please explain what do you mean by CTRL+W

(2) It is very bright!!!

Many thanks!
#6
Wraps lines.
#7
Thank you, I should have known that. Could you please advise if there exist an upper limit of characters that you may continue wrapping? I am sorry but I failed finding this issue in help files.
#8
I don't know.


Forum Jump:


Users browsing this thread: 1 Guest(s)