| View previous topic :: View next topic |
| Author |
Message |
Raymond175 Contributor


Joined: 24 Apr 2002 Posts: 72
|
Posted: Sat Aug 01, 2009 8:32 pm Post subject: Variable content spanning multiple lines? |
|
|
Hi there all,
I need to put a sql-query into a variable, but I do not want to put in all in one line.
What is the best way to span this on multiple lines?:
| Code: | %%Query =
SELECT d.domainname, e.extension, d.expiredate, r.registrar
FROM domains d
JOIN extensions e ON (e.id = d.extension_id)
JOIN registrars r ON (r.id = d.registrar_id)
ORDER BY d.expiredate ASC; |
Thanks in advance,
Raymond |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sat Aug 01, 2009 9:47 pm Post subject: |
|
|
| Code: | %%Query = "SELECT d.domainname, e.extension, d.expiredate, "
%%Query = %%Query"r.registrar FROM domains d JOIN extensions e ON (e.id = "
%%Query = %%Query"d.extension_id) JOIN registrars r ON (r.id = d.registrar_id)"
%%Query = %%Query"ORDER BY d.expiredate ASC;" |
I'm not sure this is what you meant, but this is how you'd take one long line and and put into a variable in broken down pieces so that the data in the variable is still one long line, but just that you don't have to put it all in as one long line. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sun Aug 02, 2009 7:38 pm Post subject: |
|
|
You can also turn on the VDS editor word wrap. I have never liked the VDS editor for this reason. It makes it very difficult to read code that is longer than the IDE is wide. All I can say is whom ever idea it was to not allow lines of code to wrap to the next line was very short sited It would have been nice if we could have had the IDE allow us to wrap lines like string assignments... It could have used a '~' to show that the line was wrapping of some other character like the '^'... Maybe a tool could be written that would allow you to wrap line but remove the wrap before you compile or run the code  _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
|