Page 1 of 2 [ 25 posts ]  Go to page 1, 2  Next

MasterJedi
Veteran
Veteran

User avatar

Joined: 22 Oct 2010
Age: 52
Gender: Male
Posts: 2,160
Location: in an open field west of a white house

20 Jan 2011, 10:16 am

I need something coded

TRUE GRIT

Now, I now that TRUE is one of those ubiquitous programming words used a lot in SQL and BASIC.

Was kind of hoping to get a string showing something like "IF GRIT =1 THEN TRUE" or something.

I haven't written BASIC since I was 10.

If you can in fact do this, I'd prefer it to be as complex as possible given the length of text.


_________________
That is my spot, in an ever changing world, it is a single point of consistency. If my life were expressed as a function on a four dimensional Cartesian coordinate system, that spot, from the moment I first sat on it, would be 0-0-0-0.


kxmode
Supporting Member
Supporting Member

User avatar

Joined: 14 Oct 2007
Gender: Male
Posts: 2,613
Location: In your neighborhood, knocking on your door. :)

20 Jan 2011, 10:49 am

What exactly is "TRUE GRIT"? Are you asking how to create a simple conditional in BASIC, or are you requesting more?



MasterJedi
Veteran
Veteran

User avatar

Joined: 22 Oct 2010
Age: 52
Gender: Male
Posts: 2,160
Location: in an open field west of a white house

20 Jan 2011, 11:07 am

True Grit is a movie.

You know how some things can be expressed as mathematical or programming functions such as

$DO || ! $DO ; try
try: command not found
(Do or do not, there is no try)

Just hoping there's some way to do that with the title of the movie.


_________________
That is my spot, in an ever changing world, it is a single point of consistency. If my life were expressed as a function on a four dimensional Cartesian coordinate system, that spot, from the moment I first sat on it, would be 0-0-0-0.


LordoftheMonkeys
Veteran
Veteran

User avatar

Joined: 15 Aug 2009
Age: 35
Gender: Male
Posts: 927
Location: A deep,dark hole in the ground

20 Jan 2011, 1:16 pm

MasterJedi wrote:
IF GRIT =1 THEN TRUE


I don't think this is correct syntax in any language. TRUE is a boolean constant, not a statement. Then again, I don't know anything about BASIC, so what do I know?

The only place I can think of where you would use TRUE after an IF statement is if TRUE is a macro, e.g. one defined by a #define directive or something to that effect.

And why BASIC anyway? Unless you're going to program a C64 or TI-84, learn a real language like C or Perl. You will find them a lot more powerful and less ugly.


_________________
I don't want a good life. I want an interesting one.


shibashaba
Yellow-bellied Woodpecker
Yellow-bellied Woodpecker

User avatar

Joined: 16 Aug 2007
Age: 42
Gender: Male
Posts: 65

20 Jan 2011, 11:42 pm

Quote:
True Grit is a movie.

You know how some things can be expressed as mathematical or programming functions such as

$DO || ! $DO ; try
try: command not found
(Do or do not, there is no try)

Just hoping there's some way to do that with the title of the movie.


I have no idea what your trying to do, but I don't believe true is used in basic(I could b e wrong, it's been a long time).

But anyways, true is any 1 and over. False is 0. That is all.

For example, if your trying to check for the existence of a string in a data set, and the function you call returns the number of occurances, the answer is evaluated as true or positive

When a program or function runs, it returns error codes. So, if your evaluating if there was an error, the number is 1 or above and is true.

Thats all there really is about the whole TRUE/FALSE thing. Unless your talking about bit states, in which case 0 or off is FALSE and then 1 or on is TRUE.


_________________
Open Source is capitalism applied to IP.


MasterJedi
Veteran
Veteran

User avatar

Joined: 22 Oct 2010
Age: 52
Gender: Male
Posts: 2,160
Location: in an open field west of a white house

21 Jan 2011, 10:36 am

guys, relax. It's supposed to be funny. Expressing the title of a movie with math or some programming language.

I don't personally know any programming language and I suck at math so I'm posting examples that might be grammatically incorrect.

You know how they have funny t-shirts that are marketed toward geeks?

Here are some examples:

"There's no place like 127.0.0.1"

It means "there's no place like home" only expressed as a computer or internet language.


_________________
That is my spot, in an ever changing world, it is a single point of consistency. If my life were expressed as a function on a four dimensional Cartesian coordinate system, that spot, from the moment I first sat on it, would be 0-0-0-0.


kxmode
Supporting Member
Supporting Member

User avatar

Joined: 14 Oct 2007
Gender: Male
Posts: 2,613
Location: In your neighborhood, knocking on your door. :)

21 Jan 2011, 11:52 am

var grit = true;



StuartN
Veteran
Veteran

User avatar

Joined: 20 Jan 2010
Age: 61
Gender: Male
Posts: 1,569

21 Jan 2011, 5:02 pm

kxmode wrote:
var grit = true;


if (grit("Rooster")==True) exit("Chaney");



Cornflake
Administrator
Administrator

User avatar

Joined: 30 Oct 2010
Gender: Male
Posts: 69,549
Location: Over there

24 Jan 2011, 7:58 pm

Nearest I can think of in Pascal is:

Code:
if true then Grit
where procedure 'Grit' is defined elsewhere.

Not very satisfactory though and a shorted equivalent would simply be:
Code:
Grit
which is even less satisfactory, but it's what any half-decent compiler would optimize it down to.

Or, to expand on the idea a little:
Code:
while TrueGrit do
  LookHeroic

And maybe:
Code:
with HissyFit do
  ThrowPlates


_________________
Giraffe: a ruminant with a view.


Titangeek
Veteran
Veteran

User avatar

Joined: 22 Aug 2010
Age: 31
Gender: Male
Posts: 7,696
Location: somewhere in the vicinity of betelgeuse

24 Jan 2011, 10:16 pm

Dim yesno As Boolean = True
Dim Balls As String = "Grit"

If yesno = True Then MsgBox(Balls)

that would be Visual Basic


_________________
Always be yourself, express yourself, have faith in yourself, do not go out and look for a successful personality and duplicate it.
- Bruce Lee


Cornflake
Administrator
Administrator

User avatar

Joined: 30 Oct 2010
Gender: Male
Posts: 69,549
Location: Over there

25 Jan 2011, 6:00 am

MasterJedi wrote:
"There's no place like 127.0.0.1"

:? There's no place like localhost? Nah...

~/ is where I lay my @


_________________
Giraffe: a ruminant with a view.


kxmode
Supporting Member
Supporting Member

User avatar

Joined: 14 Oct 2007
Gender: Male
Posts: 2,613
Location: In your neighborhood, knocking on your door. :)

25 Jan 2011, 11:08 am

Cornflake wrote:
MasterJedi wrote:
"There's no place like 127.0.0.1"

:? There's no place like localhost? Nah...


127.0.0.1 = home



Cornflake
Administrator
Administrator

User avatar

Joined: 30 Oct 2010
Gender: Male
Posts: 69,549
Location: Over there

25 Jan 2011, 12:01 pm

kxmode wrote:
Cornflake wrote:
MasterJedi wrote:
"There's no place like 127.0.0.1"

:? There's no place like localhost? Nah...


127.0.0.1 = home

As a network address 127.0.0.1 is localhost in the loopback net block. The name is also a TLD.
I mean, I know it's a way of saying "this computer" - but where/how does that ever become "home"?


_________________
Giraffe: a ruminant with a view.


AspiInLV
Blue Jay
Blue Jay

User avatar

Joined: 6 Jan 2010
Age: 51
Gender: Male
Posts: 88
Location: The Unemployment capitol of the US

25 Jan 2011, 12:51 pm

with the old time basic line numbering is important:

10 if(var == 1) GOTO 20
20 exit



kxmode
Supporting Member
Supporting Member

User avatar

Joined: 14 Oct 2007
Gender: Male
Posts: 2,613
Location: In your neighborhood, knocking on your door. :)

25 Jan 2011, 2:04 pm

Cornflake wrote:
kxmode wrote:
Cornflake wrote:
MasterJedi wrote:
"There's no place like 127.0.0.1"

:? There's no place like localhost? Nah...


127.0.0.1 = home

As a network address 127.0.0.1 is localhost in the loopback net block. The name is also a TLD.
I mean, I know it's a way of saying "this computer" - but where/how does that ever become "home"?


127.0.0.1 is reserved as the 'HOME' address for any network card installed in a computer. This is known as the 'loopback address' and is used to test if the TCP/IP protocol is functioning properly on your machine. Because this address only works on your machine and no where else 127.0.0.1 is sometimes simply referred to as the 'HOME' address.



Cornflake
Administrator
Administrator

User avatar

Joined: 30 Oct 2010
Gender: Male
Posts: 69,549
Location: Over there

25 Jan 2011, 2:58 pm

kxmode wrote:
Cornflake wrote:
kxmode wrote:
Cornflake wrote:
MasterJedi wrote:
"There's no place like 127.0.0.1"

:? There's no place like localhost? Nah...

127.0.0.1 = home

As a network address 127.0.0.1 is localhost in the loopback net block. The name is also a TLD.
I mean, I know it's a way of saying "this computer" - but where/how does that ever become "home"?

127.0.0.1 is reserved as the 'HOME' address for any network card installed in a computer. This is known as the 'loopback address' and is used to test if the TCP/IP protocol is functioning properly on your machine. Because this address only works on your machine and no where else 127.0.0.1 is sometimes simply referred to as the 'HOME' address.

Yep, I know what it's for. :lol:
I was querying the source for the use of the word "home", when I've only ever seen 127.0.0.1 referred to as "localhost" - which is actually what it is, hence the TLD.
The "home" address of this particular PC is 192.168.1.100, and the "home" address of my LAN's webserver is 192.168.1.241, and the "home" address of my server is 192.168.1.254 and so on.
Each of those PCs has a localhost address of course, but it's a loopback for use by the machine it's local to - not a "home" address. That's why each machine has a specific address assigned from one of the private ranges: that IP is the macine's "home" address. How else could I reach it from elsewhere on the LAN? (excluding DHCP, which I'm not using)

Just curious about where the er, curious use of the word "home" came from is all.


_________________
Giraffe: a ruminant with a view.