Page 1 of 1

creating hyperlinks.

Posted: Sat Nov 02, 2013 8:49 pm
by chris25
It took me one day 2 minutes to make my first hyperlink in raw HTML, after about an hour I am more lost than ever. I have read in the dictionary about link linktext linkclicked. I have especially read with interest the tutorial titled "Creating hypertext links in fields" and this while being exciting at first to find turned out to be a confusing nightmare to understand. For starters why do you need to put anything in the message box? This is not explained. Secondly and the most important: These instructions which I read at least 6 times - instruction number 8 has you going around in circles. Repeating verbatim has me lost, a clear explanation of what one needs to do is all that is needed. I entered what he said into message box and changed obviously my website and field name. I simply got an error message in the message box complaining about double binary operators. Instruction 8 sends you to number 6 with a lead question mark bearing down on your head. I read about chunk operators but that did not explain what he was on about at all. As I said I came to HTML with no knowledge and was making my first hyperlinks within minutes from a book. Am I really stupid? Yes please answer I really don't care.


Setting the textStyle to link.

6. Open the message box and type the following, followed by a return/enter:

set the textStyle of word 2 of line 1 of fld "text" to link -- this sets the second word of the first line as having a link textStyle.

This should result in the indicated word having a blue, underlined, link appearance.

Linking the link to a destination (website).

7. Enter the following in the message box, followed by a return/enter:

set the linkText of word 2 of fld "text" to / "http://www.runrev.com" -- this makes the link, when clicked, open a web browser that opens this URL.

8. Repeat instruction 6, changing the chunk descriptor to reflect the second "here" in the text field.

Re: creating hyperlinks.

Posted: Sat Nov 02, 2013 9:12 pm
by Dixie
Chris..

I have attached a stack... it might help... the linkclicked handler is in the card script

Re: creating hyperlinks.

Posted: Sat Nov 02, 2013 9:42 pm
by chris25
Thankyou very much for that stack. Unfortunately somewhat lost here - both of your fields are named "field" yet you have a put command pointing to "field 2"? and double clicking the field with the text just brings up the properties box "field"

Your text box field has the 'G' where usually you click this to establish a link for text, it is unchecked as far as I can see?

You use the 'switch' and having looked at that in the dictionary I found it awkward to work out how this is used in your hyperlinking, that I did not understand.

Having said all that I can not get mine to work despite repeating exactly what you have written.

Re: creating hyperlinks.

Posted: Sat Nov 02, 2013 10:14 pm
by chris25
Was that it? :x

Then what is all that garbage about in the tutorial file? Ok it is not garbage I know, but it is damn well misdirection! and the hour spent accessing help files from here to the end of the galactic universe. Even the beginners PDF is silent on this matter and that was the very first place I looked.

I just typed the following for petes' sake.... :x

on linkClicked
launch URL "http://www.aqualarue.com"
end linkClicked

its even easier than HTML.

Re: creating hyperlinks.

Posted: Sat Nov 02, 2013 10:27 pm
by dunbarx
Dixie was just doing what many of us do. When making a quick stack for whatever reason, it is not often that we will not name the controls. So when he referred to "field 2", he knew which field he meant, the second one he created.

There is an order to all controls on a card, initially set at creation time, and proceeding from 1 within each object class. You should be able to fix this in your head so either you know which one he meant, or, better, you could rename the fields to your liking, remembering to change the handlers accordingly. This is all a good learning exercise.

But if you were tripped up on the fact that the reference to "field 2" did not compute in light of the discovery that the fields were all named "field" (the default name for a new field), then I have to tell you what many have said here before:

You are far ahead of yourself, in that you have created a working stack, but do not know the fundamentals of LiveCode. This is both a feature of the program and a trap. It is so accessible and seemingly simple that a new user can get well involved, but not really know the underlying structure, its conventions, and its rules. Again, this is both good and bad, as you have discovered. Do read the user manual, and go through all the lessons. You can do this while you are working, of course, but always remember that any issues you encounter will likely be due to inexperience.

I will leave it to Dixie to reply to the specific issues. But the good news is that you are going to learn quickly, even in this too-quick manner. You already are.

Craig

Re: creating hyperlinks.

Posted: Sat Nov 02, 2013 11:23 pm
by chris25
Hi Craig, yes I agree wit you. Livecode interface is accessible and that can be a trap - I know what you mean. But as I have said before, I have been through the pdf and three quarters of the university and felt quite honestly I was not understanding a lot at all. When I actually threw myself in and devised my own stacks and tried looking at other peoples' codes it was then and Only then that parts of the beginners lessons and the pdf started making any sense. Like people say if you want to learn to use a computer for goodness sake do not read the manual first. I have learned so much in the last three weeks by experimenting and only then referring to manuals and help files in order to cement that fact or this fact. Trouble is, and this is the ONLY downside, the manuals and help files often explain things in a way which 'appears' to disguise the most essential information needed right away for a beginner (the hyperlink question a case example, and I never even read what I eventually coded as written above I still can not find this information) - not by any means a criticism at all, far from it - I would not be here if it were not for the advantages and hard work of many people since hypercard, and their dedication as I have read about Klaus and Jacque for example and I know you are one of them so from that perspective there can only be appreciation that the idea of coding is within my reach at all.

Kindest regards
chris

Re: creating hyperlinks.

Posted: Sun Nov 03, 2013 2:36 am
by dunbarx
Chris.

You are speaking to the most annoyingly strident advocate in any of these forums of learning first and foremost by doing. I advise new users to make either a calculator, address book or, say, a useless gadget that tracks all possible mouse events as you move and click around a card. As Mao said, " just become a programmer".

I only mentioned reading stuff because you were already doing physical stuff. Try teaching someone to drive a car by showing them videos and making sure they get a 100 on the written test. No problem taking a nap in the back seat with that person at the wheel, eh? But of course you do need some framework in which to start, but the first stack should be made on the first day, empty as need be, until you drag your first button from the tool palette.

Keep at it. I sense a softening. You are in for a world of fun, and I am not being hyperbolic when I say you will soon feel triumph. Do not hesitate to write back often. There are new users with 100 posts, all of them questions and complaints. I hate it when a name disappears.

Craig