Results 1 to 12 of 12

Thread: A simple request to those who post source...

  1. #1

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935

    A simple request to those who post source...

    As you know, the API calls can get unrulingly long:

    VB Code:
    1. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ... ' wow this is a long call

    So if it is really long, can you do this instead to avoid horizontal scrolling?
    VB Code:
    1. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    2.         (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    3.         ByVal lpParameters As String, ByVal lpDirectory As String, _
    4.         ByVal nShowCmd As Long) As Long
    Last edited by filburt1; Oct 7th, 2001 at 08:26 PM.

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    I don't like line continuators and I always take them out

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629

    I do agree

    u'r wish is our command filburt1
    well.. that is if I remember it...
    -= a peet post =-

  4. #4

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Originally posted by chrisjk
    I don't like line continuators and I always take them out
    Then can you put it in a [font=courier new]api call here[/font] tag then, so it uses breaking instead of nonbreaking spaces?

  5. #5
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    what's it worth?

  6. #6

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    If you don't do it I'll start making some more avatars to add to the 40+ I already have.

  7. #7
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Originally posted by chrisjk
    I don't like line continuators and I always take them out
    Filburt1,

    Most of your gripes I generally agree with. HOWEVER, when it
    comes to coding API functions, My belief is to code the function on
    ONE line, for the sole reason that those stupid _ line continuation
    characters are ugly and illogical. A function is defined by a single
    line, SO WHAT? I tend to make my posts here fit into the reply
    box by entwering hard returns where needed, BUT thats to make
    it look nice. When it comes to VB Code, I'm not going to do that,
    because spanning the screen is OK. So someone has to scroll to
    the right. It still LOOKS better in the form code that way. As
    opposed to being disjointed and staggered, if you use the _
    method.

    No.
    Not with a Bar, 'cause EOL's so far.
    I Just don't like it, Sam I am!

  8. #8

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    I used to loathe them as well, but after working two years with the Java Style Guide by NASA (I was a subcontractor) I had to keep my lines to 80 chars or less. Just a habit. You do have to admit that horizontal scrolling is annoying though.

  9. #9
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    But what does that API do?
    You surely need comments :
    VB Code:
    1. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long 'I wonder how far this API makes it scroll and I wonder if it makes Turtle blood boil :D Anyways, i think the use of vbcode / vbcode is a much better mission that you could devote your life to :p
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  10. #10
    chenko
    Guest
    my suggestion to you, get a mouse with 3 buttons or more, and if you do ... USE IT !

  11. #11

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Originally posted by beachbum
    But what does that API do?
    You surely need comments :
    VB Code:
    1. [size=100]Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long 'I wonder how far this API makes it scroll and I wonder if it makes Turtle blood boil :D Anyways, i think the use of vbcode / vbcode is a much better mission that you could devote your life to :p[/size]
    It was hard finding the "Submit Reply" button.

  12. #12
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Originally posted by filburt1
    It was hard finding the "Submit Reply" button.
    Longest API declaration I could find...

    VB Code:
    1. [size=10][b]Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long[/b][/size]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width