You are not logged in.

#1 2005-11-05 10:58:45

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,293
Website

Virtual variable?

In general, regardless of language, when saving an input in a textbox what's the variable? I tried $0 and $1.

Example in Prima (Perl):
Prima::Simple->write('/work/prima/mytest', "$0");


Markku

Offline

#2 2005-11-05 11:56:11

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Virtual variable?

$0 is your program and $1 to whatever are the arguements.

rasat --hellyeah --getRdone something

$0   /usr/bin/rasat
$1 --hellyeah
$2 --getRdone
$3 someting

Try storing it at top the top (or as soon as you can) as something different like:
arg_one=$1

then call on it as $arg_one.

Offline

#3 2005-11-06 04:50:30

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,293
Website

Re: Virtual variable?

Thanks, I didn't know the details of these variable numbers.

Didn't answer the question but I think its the "wierdness" of Prima. It seems when dealing with reading and writing text files it runs "around the bush". The documentation, examples are of no practical value for a newbie like me.

Example to save a text, all samples open/read the file and then save/write the same file. The new entries will never be saved, only the original content if any. This is why I asked what variable stores the new entries in the textbox or inputbox before saved in the text file.


Markku

Offline

#4 2005-11-06 04:54:02

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Virtual variable?

how is that 'regardless of language'?

I've never heard of Prima, so I can't say how you use it. In swing, there is a JTextArea.getText() method, I know this off the top of my head. There must be something similar for your toolkit.

Dusty

Offline

#5 2005-11-06 04:55:54

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Virtual variable?

oh, didn't read your original post right.

It might be something like $* if its similar to bash

Offline

#6 2005-11-06 05:14:52

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,293
Website

Re: Virtual variable?

Dusty wrote:

how is that 'regardless of language'?

I thought there is a common storage variable like $0 for all languages.

Thanks, I took a look online about the TextArea, there seems to be a class. Hhmm, why could not Prima doc say about it in the samples.

I will also try $*.


Markku

Offline

Board footer

Powered by FluxBB