Return on a disp function - input

I'm trying to display text in matlab, but it's quite long and going off the side of the command window. Is there a way for me to return that and skip down a line part way through the text?
In this specific example I am using the input function "x=input('3 lines worth of text')" but I would love to know for disp('') function as well.

Related

CorelDRAW VBA Text Manipulation

I want to write a VBA script for CorelDRAW to assign an Object Style to various text strings within a Paragraph Frame.
Something like (psuedo code example):
- move cursor forward to next Start of Line
- select text from cursor to next Tab character
- set selected text to Object Style 1
I have not been able to find any examples or doco of using scripting to do text manipulation in CorelDRAW. I'd be happy to do it using Javascript (available in CDGS 2019) if that is easier.
The way I see this script working is that I would manually position the text cursor at the start of the paragraph frame, hit a shortcut key to invoke the script, and then repeat until all desired changes are made. Possibly add looping at a later step.
Can somebody point me in the right direction please.

Executing a Command After Concatenating A String

I am hoping to get some help on a formula I've been banging my head against the wall over. Essentially I am using Concatenate to produce a formula, when this is then copied into the final cell, it won't execute. I've tried using the hidden Eval function but that doesn't work for this specific part, however, it does for the other. The only thing that seems to solve it is either pressing Enter on each cell, or using the Find/Replace function. However, I need this to happen automatically. I've recorded using Find/Replace without any luck. The displayed color aspect is a custom function that works perfectly. I have had to change some of the wording for sensitivity reasons.
Concatenate Part:
=CONCATENATE("=IF(DisplayedColor(",I3,")=38,",eval(I3)*100,",""",E3,")")
Result to Execute:
=IF(DisplayedColor('[Spreadsheet]Tab1'!$BV$19)=38,-6.43801947500129,"")
Use the Indirect Function as follows:
Formula = INDIRECT(CONCATENATE("=IF(DisplayedColor(",I3,")=38,",eval(I3)*100,",""",E3,")"))
The INDIRECT function is useful when you want to return a value, based on a text string.

Carriage Return in VBscript?

I am writing a script in VBscript and I need to include line breaks or carriage returns. I was using the following code:
objSelection.TypeParagraph()
But this creates to big of a space between lines. The best way I can think to explain it is, when you are in Microsoft word, and you type a line, if you were to press Shift + Enter, you would get two separate lines close together, whereas pressing just Enter will do a full Carriage return (which I don't want). I will demonstrate here.
How can I achieve the same result as 'Shift + Enter' but through VBscript?
Thank you very much.
Assuming you're asking about Word VBA, you can do it like this:
objSelection.TypeText(Chr(11))
Generally, if you can't find out how to do something in VBA that you can do in the application, just record a macro while you perform the required steps and then look and see what VBA has been generated.

Word VBA - Load part of doc into variable, and run .indexOf to search

Okay, I am a Javascript programmer and VBA is driving me insane - I know nothing about it and it is like pulling teeth to find simple documentation on the simplest thing.
I'm literally trying to run a little script to auto-format a document, partly based in content.
I want to grab the third line of document, or first 100 characters, I really don't care, and run the equivalent of String().indexOf('foobar') on it, to check if that part of the document contains a string.
I cannot for the life of me find how to:
a. Load text selection into a variable.
b. Run a sane semblance to indexOf.
Can someone please help? And maybe point me to a sane VBA documentation that is not Micrsoft?
a. Load text selection into a variable.
Identify a range (Word.Range) you want and get the Text property of that range.
For instance,
dim s as string
s = ThisDocument.Paragraphs(3).Range.Text
b. Run a sane semblance to indexOf.
Is InStr no good?
msgbox InStr(s, "foobar")

Incremental paste plugin?

I know that often using a for loop to generate repetitive content is the better way than pasting something 20 times and changing each paste to the correct number by hand. But let's say for cases where content is hard-coded and I just want a list from 1-20.
I would like a text editor with a "smart" paste command that takes any number imbedded in a string on the clipboard and increments it each time I paste. If it doesn't exist, I will make a plugin.
I'm trying to think of a good 2-stroke keyboard shortcut to do it, close to the ctrl-V. Maybe ctrl-g or numpad_+ (in an app with no zooming).
Does it exist?
In Zeus this can be easily done as follows:
Column mark the area to be converted to a numbers
Use the Macros, Execute Script menu
Type in numbers to run the numbers Lua macro
Type in the first number of the sequence
The marked area will be replaced by an incrementing sequence of number starting at the first number provided in step 4.
I'm trying to think of a good 2-stroke
keyboard shortcut to do it,
Making this into a key stoke action is as simple as binding the numbers Lua macro to the keyboard.
Here is an example of how it works. If 1 values in the text below are column marked and the macro executed with a starting number of 1000:
Field_1
Field_1
Field_1
Field_1
the following text changes will be made:
Field_1000
Field_1001
Field_1002
Field_1003
Armed bear J has a renumber region command, as well as a case-preserving replace-in-files, which means I often keep it around for those features.
TextPad is another text editor with a Fill Region function, for filling with a character, a string, or incrementing numbers (starting from X, with left- or right-alignment, and space- or zero-filled.)
I used Notepad++ now, but I have to keep TextPad around just for that number-filling function.