problem with DisplayHttpLink

Pertex
29 Nov 2012, 15:33
I have a problem with these two commands in Q5.2.

 x= DisplayHttpLink("RockyBeach","www.rocky-beach.com",  false) 
x=DisplayMailtoLink("link", "w@w.de")


Both commands return

Error running script: Error compiling expression 'DisplayHttpLink("RockyBeach","www.rocky-beach.com", 0)': Der Wert darf nicht NULL sein. Parametername: key

Error running script: Error compiling expression 'DisplayMailtoLink("link", "w@w.de")': Der Wert darf nicht NULL sein. Parametername: key


Any ideas?

Alex
29 Nov 2012, 15:47
Those functions don't return a value, they output directly. So you can't set "x" to their return value.

Pertex
29 Nov 2012, 15:53
Ah yes. Would it be ok that I add two functions returning a string?

Alex
29 Nov 2012, 16:01
Why do you need the string returned? You can always just manually put an <a> tag into your string anyway if you need to.

jaynabonne
29 Nov 2012, 17:34
If I can chime in... I guess it depends on how "user friendly" an interface you want to provide for novice or non-technical users. If the idea is to provide convenient wrapping functions so that someone who is not technically savvy (say) doesn't need to know all the HTML tags, then having a function like "GetHttpLink" would be a nice "cushion".

Along the lines of what Pertex is asking, I could see it broken down like this:

1) GetHttpLink returns a string with the encoded link.
2) DisplayHttpLink would just call GetHttpLink and pass it to msg... if you even need it.

To be honest, I can see a good use for GetHttpLink, but I can't even imagine a case where I'd ever want to dump out a link on a single line by itself (which is the drawback to "msg" enforcing a line break). I'd prefer the Get over the Display any day as a general function. And, again my opinion, if the idea is that people should be switching to using tags for links in most normal cases anyway, and given the highly limited utility of DisplatHttpLink as is, I think if you don't want to put in GetHttpLink functionality, you might as well get rid of DisplayHttpLink, as its counter to this more HTML-centric direction, and it's almost useless as it exists now.

Just my two cents... :)

Pertex
29 Nov 2012, 21:39
then there are now 4 cents :D