Posted: Thu Feb 16, 2006 3:49 pm
				
				Nice to see a new maintainer for Japbe! I think I'll switch back to Japbe! Thanx!
			http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
; Original
P=42 ; The real meaning
; This comment should stay left aligned, it is a description for the block of code
For n = 1 To 1000 ; This line ends with 1000
  A.f=Sqr(n)
  Result = CallFunctionFast(FunctionWithALongName,A,b,lots,of,1000) ; Fiddle the widgit
Next
; This went wrong
P=42 ; The real meaning
     ; This comment should stay left aligned, it is a description for the block of code
For n = 1 To ; This line ends with 1000
  A.f=Sqr(n)
  Result = CallFunctionFast(FunctionWithALongName,A,b,lots,of,100; Fiddle the widgit
Next
; Not so bad, the first line was tabbed to col 21 before adjusting
P=42               ; The real meaning
                   ; This comment should stay left aligned, it is a description for the block of code
For n = 1 To 1000  ; This line ends with 1000
  A.f=Sqr(n)
  Result = CallFunctionFast(FunctionWithALongName,A,b,lots,of,1000); Fiddle the widgit
Next
The lines with a comment [';'] in the first column are untouchedRichardL wrote:1. Lines with no code and a comment should (a) be left un-touched or (b) tabbed to the same as the first character on the last non-blank line.
Should be fixedRichardL wrote:2. If the comment cannot go at the wanted indent because a code line is too long then (a) leave it alone or (b) move it to the end of the code +1. At present it damages the code!
FixedFlype wrote:missing keyword: 'As' ( Import/EndImport )
LOL, you are doing same as Fred, it's funny... nevermind...gnozal wrote:Fixed

Code: Select all
  
  
  If 1  
  ; >>> This is the target layout
  ; Data import over USB
  If GoOn     
    For ImportData.w = 1 To 2
      Select ImportData.w
        Case 1
          ; Set up start and bytes for S/Pad+TIF+TSDB Section
          USB_Start_address.l = 0                         ; Start of download S/Pad
          USB_Size.l          = *StartOfLOG               ; Number of bytes to download
        Case 2
          ; Set up start and bytes for the LOG section
          USB_Start_address.l =  USB_LogClip_Start.l      ; Start of download
          USB_Size.l          =  USB_Log_Clip_Size.l      ; Number of bytes to download
      EndSelect
      
      ; *****************
      ; LOTS OF CODE HERE
      ; *****************
      
    Next
  EndIf
  
  ; >>> As entered by me 
       ; Data import over USB
  If GoOn     
    For ImportData.w = 1 To 2
      Select     ImportData.w
        Case 1
     ; Set up start and bytes for S/Pad+TIF+TSDB Section
            USB_Start_address.l = 0                     ; Start of download S/Pad
          USB_Size.l          = *StartOfLOG   ; Number of bytes to download
       Case 2
                ; Set up start and bytes for the LOG section
          USB_Start_address.l =  USB_LogClip_Start.l; Start of download
           USB_Size.l          =  USB_Log_Clip_Size.l      ; Number of bytes to download
            EndSelect
      
      ; *****************
      ; LOTS OF CODE HERE
      ; *****************
      
    Next
  EndIf  
  
  ; >>> After CNTRL+TAB with all lines highlighted. Standard jaPBe gets the 
  ; >>> indenting of lines with comments right.
  
  ; Data import over USB
  If GoOn     
    For ImportData.w = 1 To 2
      Select     ImportData.w
        Case 1
          ; Set up start and bytes for S/Pad+TIF+TSDB Section
          USB_Start_address.l = 0                     ; Start of download S/Pad ***
          USB_Size.l          = *StartOfLOG   ; Number of bytes to download
        Case 2
          ; Set up start and bytes for the LOG section
          USB_Start_address.l =  USB_LogClip_Start.l; Start of download
          USB_Size.l          =  USB_Log_Clip_Size.l      ; Number of bytes to download
      EndSelect
      
      ; *****************
      ; LOTS OF CODE HERE
      ; *****************
      
    Next
  EndIf 
  
  ; >>> After tidy up comments, highlight from line with *** to end. OOOPS!
  ; Data import over USB
  If GoOn     
    For ImportData.w = 1 To 2
      Select     ImportData.w
        Case 1
          ; Set up start and bytes for S/Pad+TIF+TSDB Section
          USB_Start_address.l = 0; Start of download S/Pad ***
          USB_Size.l          = *StartOfLOG; Number of bytes to download
        Case 2
          ; Set up start and bytes for the LOG section
          USB_Start_address.l =  USB_LogClip_Start.l; Start of download
          USB_Size.l          =  USB_Log_Clip_Size.l; Number of bytes to download
      EndSelect
      
          ; *****************
          ; LOTS OF CODE HERE
          ; *****************
      
    Next
  EndIf 
  
  ; >>> Inserted blank line and then tidy comments, *** to end
  ; Data import over USB
  If GoOn     
    For ImportData.w = 1 To 2
      Select     ImportData.w
        Case 1
          ; Set up start and bytes for S/Pad+TIF+TSDB Section
          
          USB_Start_address.l = 0                     ; Start of download S/Pad ***
          USB_Size.l          = *StartOfLOG           ; Number of bytes to download
        Case 2
                                                      ; Set up start and bytes for the LOG section
          USB_Start_address.l =  USB_LogClip_Start.l  ; Start of download
          USB_Size.l          =  USB_Log_Clip_Size.l  ; Number of bytes to download
      EndSelect
      
                                                      ; *****************
                                                      ; LOTS OF CODE HERE
                                                      ; *****************
      
    Next
  EndIf 
  
  
EndIf Hmm.Flype wrote:About PB4.0, I encountered a bug/problem with jaPBe that didn't occurs in the official IDE.
I can't compile projects that are using Import/EndImport for importing a custom .lib,
i mean for example fmod.lib, 7z.lib, or others.
NOT the ones in the /purelibraries/windows/librairies/.
Code: Select all
Import "C:\Purebasic400\Program\PureZIP_O.lib"
ZLIBCompress(*DestBuffer, *DestBufferLen, *SourceBuffer, SourceBufferLen.l) As "_compress@16"
ZLIBUnCompress(*DestBuffer, *DestBufferLen, *SourceBuffer, SourceBufferLen.l) As "_uncompress@16"
etc..
EndImport
Code: Select all
XIncludeFile "PureZIP_ZLIB_IMPORT.pb"
etc...
Code: Select all
    ; >>> As entered by me 
    ; Data import over USB 
    If GoOn      
      For ImportData.w = 1 To 2 
        Select     ImportData.w 
          Case 1 
            ; Set up start and bytes for S/Pad+TIF+TSDB Section 
            USB_Start_address.l = 0                     ; Start of download S/Pad 
            USB_Size.l          = *StartOfLOG   ; Number of bytes to download 
          Case 2 
            ; Set up start and bytes for the LOG section 
            USB_Start_address.l =  USB_LogClip_Start.l; Start of download 
            USB_Size.l          =  USB_Log_Clip_Size.l      ; Number of bytes to download 
        EndSelect 
        
        ; ***************** 
        ; LOTS OF CODE HERE 
        ; ***************** 
        
      Next 
    EndIf  Code: Select all
    ; >>> As entered by me 
    ; Data import over USB 
    If GoOn      
      For ImportData.w = 1 To 2 
        Select     ImportData.w 
          Case 1 
            ; Set up start and bytes for S/Pad+TIF+TSDB Section 
            USB_Start_address.l = 0                     ; Start of download S/Pad 
            USB_Size.l          = *StartOfLOG           ; Number of bytes to download 
          Case 2 
            ; Set up start and bytes for the LOG section 
            USB_Start_address.l =  USB_LogClip_Start.l  ; Start of download 
            USB_Size.l          =  USB_Log_Clip_Size.l  ; Number of bytes to download 
        EndSelect 
        
        ; ***************** 
        ; LOTS OF CODE HERE 
        ; ***************** 
        
      Next 
    EndIf