help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

newbie question: how to scrape a command line arg with argv()


From: Paul McDonough
Subject: newbie question: how to scrape a command line arg with argv()
Date: Thu, 23 Jan 2014 21:44:00 +0000

Hi -

Apologies in advance for asking what is surely a shockingly basic question, expressed in highly inexpert terminology.

I'm a non-programmer trying to modify an octave function into a script for a project (never seen a scripting language before). The function works nicely from the octave command prompt, something like

myfunction("filename")

However I need to call it from another program, i.e. like a call from a Windows command line. So I have made myfunction into myscript, and now the other program calls something like

octave myscript filename

And myscript uses argv() to get filename. But what argv() actually gets is a one-element array, and I need to pass that element (a string) on to another function. At the moment I'm getting/passing the array, which obviously isn't right.

Dumb question of the day: how do I get a string out of a one element array, so that I can assign it to a variable in the script called filename, and pass it along to the next function?

Thanks for any help,
Paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]