Search found 43 matches

by waltzmn
2020-02-24 15:47:37
Forum: Nisus Writer Pro Macros
Topic: Variable Typing
Replies: 5
Views: 2436

Re: Variable Typing

martin wrote: That's always a good idea! I'll see about adding some cross-references between the topics you've discussed. Thanks :) Thank you. I can think of some cases where not casting types is useful, but they're mostly for debugging. (Real debugging, not joke code such as I used in this thread.)...
by waltzmn
2020-02-23 17:10:28
Forum: Nisus Writer Pro Macros
Topic: Variable Typing
Replies: 5
Views: 2436

Re: Variable Typing

Thanks for your reply. Both your knowledge and your willingness to share are amazing. phspaelti wrote: I think this stuff is explained reasonably well in the Macro Language reference in appropriate places. I'm not sure that there is a simple answer, probably because the underlying implementation is ...
by waltzmn
2020-02-23 08:14:01
Forum: Nisus Writer Pro Macros
Topic: Variable Typing
Replies: 5
Views: 2436

Variable Typing

Nisusy folks: I'm intermittently teaching someone about programming with NWP macros. I was recently trying to explain the concept of variable typing. I wrote a tiny piece of example code: $Name = 'George' $Number = 3 $FullName = $Name + $Number My goal, quite frankly, was to have this fail with a ty...
by waltzmn
2020-02-10 10:55:43
Forum: Nisus Writer Pro
Topic: removing page break mid-paragraph
Replies: 18
Views: 2104

Re: removing page break mid-paragraph

This is only a wild thought, but I notice that your document is fairly long -- and has curious page numbering. The page number in your screen shot is 21, yet the bar at the bottom says you're on page 3 of 16. This raises two thoughts: 1. Long documents take time -- a lot of time -- to repaginate, an...
by waltzmn
2019-12-30 06:39:19
Forum: Nisus Writer Pro Macros
Topic: Foreach Command and Variable Scope
Replies: 2
Views: 1038

Re: Foreach Command and Variable Scope

phspaelti wrote: Note that the foreach loop has a variant that allows you to get the index of the current value: foreach $i, $value in $values $values[$i] = … end That did it! Thank you again. At this point, pending field testing, the macro seems to be done, so maybe you'll be through with me for a ...
by waltzmn
2019-12-29 10:04:47
Forum: Nisus Writer Pro Macros
Topic: Foreach Command and Variable Scope
Replies: 2
Views: 1038

Foreach Command and Variable Scope

Hello again, kind people. Apologies again for being apparently the only user asking questions here. At least I'm giving you something to read -- and I'm definitely learning things! I'm still working on this CSV macro, and am having a problem, I think, with variable scope. What I need to do is take a...
by waltzmn
2019-12-28 07:00:23
Forum: Nisus Writer Pro Macros
Topic: Boolean Operation Evaluation
Replies: 3
Views: 1979

Re: Boolean Operation Evaluation

In reply to: phspaelti » 2019-12-27 22:34:43 Hello Bob, Have you tried them? :wink: Yes, I had tried them -- that's how I knew that an invalid test halted the macro instead of, say, reporting an error and asking to continue. :-) But I didn't know if there was a general rule. If it's in the manual, I...
by waltzmn
2019-12-27 17:15:27
Forum: Nisus Writer Pro Macros
Topic: Boolean Operation Evaluation
Replies: 3
Views: 1979

Boolean Operation Evaluation

Boolean Operation Evaluation Good People -- I seem to be the only person asking questions these days. :-) Apologies twice for taking so much of your time, because I'm going to start with a lecture. NisusWriter macros allow two binary Boolean operators, AND (&&) and OR (||). AND is true if both state...
by waltzmn
2019-12-23 12:01:43
Forum: Nisus Writer Pro Macros
Topic: Why does the Split object surround everything with quotation marks?
Replies: 4
Views: 1387

Re: Why does the Split object surround everything with quotation marks?

Many thanks for all the help! on 2019-12-23 12:04:59 phspaelti wrote: Hello Bob, Just to answer your immediate question, it isn't the the .split command that is putting quotes around things, it's the Type text command that's doing that. Or to put it more accurately, the Type text creates a string co...
by waltzmn
2019-12-23 07:03:25
Forum: Nisus Writer Pro Macros
Topic: Why does the Split object surround everything with quotation marks?
Replies: 4
Views: 1387

Why does the Split object surround everything with quotation marks?

Good people, I'm working on a macro to take data from one CSV file, reformat it, and export it as another CSV file. And learning how much I didn't know about the macro language while I'm at it. :-) To load the data from the first CSV file, I'm using the .split command: $TheFields = $MyCurrentRecord....
by waltzmn
2019-12-17 16:45:08
Forum: Nisus Writer Pro Macros
Topic: Extremely basic question: How do I know if I found something
Replies: 6
Views: 1711

Re: Extremely basic question: How do I know if I found something

phspaelti wrote: The Find command returns the number of hits—0 for none, otherwise a positive number—which is why it's possible to check it with if. However the Find command will work via the GUI, which is slow and will change your current selection. If all you want to do is check the document, it w...
by waltzmn
2019-12-17 09:22:13
Forum: Nisus Writer Pro Macros
Topic: Extremely basic question: How do I know if I found something
Replies: 6
Views: 1711

Re: Extremely basic question: How do I know if I found something

phspaelti wrote:
Find returns the number of hits. So you can write
(etc.)

Wonderful. Thank you!
by waltzmn
2019-12-17 07:35:54
Forum: Nisus Writer Pro Macros
Topic: Extremely basic question: How do I know if I found something
Replies: 6
Views: 1711

Extremely basic question: How do I know if I found something

Good people -- I have a situation where I need to have a macro check whether a file is in the proper format for a particular task. The way to test this is to see if it contains a series of text strings; if it has all of them, it is (almost certainly) right; if it doesn't, it's definitely wrong. So w...
by waltzmn
2019-09-30 08:08:09
Forum: Nisus Writer Pro
Topic: Line spacing when using Combining Diacritical Marks
Replies: 22
Views: 6255

Re: Line spacing when using Combining Diacritical Marks

Elbrecht wrote: OK I am on High Sierra – does it make this difference for you? There used to be available the US Extended keyboard and the newer ABC Extended does about the same work – just on a more general naming address. Character Map and PopChar are of help too – but then the baseline should sta...
by waltzmn
2019-09-29 14:03:36
Forum: Nisus Writer Pro
Topic: Line spacing when using Combining Diacritical Marks
Replies: 22
Views: 6255

Re: Line spacing when using Combining Diacritical Marks

Correcting my own post -- This was much clearer than what you said last time -- thank you for clarifying. I was able to follow the instructions this time. But, on my machine, it still doesn't work. The behavior is the same whether using ABC or US keyboard and whether typing the keystroke for the dia...