Jump to content
Sign in to follow this  
gcue

tidy code before posting in forum?

Recommended Posts

gcue

hello world,

i have been noticing lately - wasn't the case before i don't think..

where i tidy my code before posting it with autoit tags

If $always_on_top = "True" Then
    $GUI = GUICreate($script_version, 320, 310, $x_position, $y_position, $GUI_SS_DEFAULT_GUI, $WS_EX_TOPMOST)
Else
    $GUI = GUICreate($script_version, 320, 310, $x_position, $y_position, $GUI_SS_DEFAULT_GUI)
EndIf
but the spacing is thrown off when i post, anyway around this?

thanks!

Edited by gcue

Share this post


Link to post
Share on other sites
gcue

hmm looks to be working now - weeeeird

test....

While 1
;1st camera
$bRecvtmp_A = TCPRecv($iSocket_A, 4096, 1) ;4kb

If @error = 0 And BinaryLen($bRecvtmp_A) > 0 Then
$bStream_A &= $bRecvtmp_A

If $iImgLen_A = 0 Then
$sStream_A = BinaryToString($bStream_A)

$iContLenPos_A = StringInStr($sStream_A, "Content-Length: ", 2)
$iEOH_A = StringInStr($sStream_A, @CRLF & @CRLF, 2, 1, $iContLenPos_A)

If $iEOH_A > 0 And $iContLenPos_A > 0 Then
$sTrim2ContLen_A = StringTrimLeft($sStream_A, $iContLenPos_A + $iContLengthLen_A - 1)

$iImgLen_A = Number(StringLeft($sTrim2ContLen_A, StringInStr($sTrim2ContLen_A, @CR, 2) - 1))

$bStream_A = BinaryMid($bStream_A, $iEOH_A + 4)
EndIf
EndIf

If $iImgLen_A > 0 Then
$iStreamLen_A = BinaryLen($bStream_A)
If $iStreamLen_A >= $iImgLen_A Then
If Not $blGUIMinimized Then
$hBMP_A = Load_BMP_From_Mem($bStream_A)

$hHBITMAP2_A = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBMP_A)

_WinAPI_DeleteObject(_SendMessage($hPic_A, $STM_SETIMAGE, 0, $hHBITMAP2_A))

_GDIPlus_ImageDispose($hBMP_A)
_WinAPI_DeleteObject($hHBITMAP2_A)
EndIf

$iImgLen_A = 0
EndIf
EndIf
EndIf

;2nd camera
$bRecvtmp_B = TCPRecv($iSocket_B, 4096, 1) ;4kb

If @error = 0 And BinaryLen($bRecvtmp_ B) > 0 Then
$bStream_B &= $bRecvtmp_B

If $iImgLen_B = 0 Then
$sStream_B = BinaryToString($bStream_ B)

$iContLenPos_B = StringInStr($sStream_B, "Content-Length: ", 2)
$iEOH_B = StringInStr($sStream_B, @CRLF & @CRLF, 2, 1, $iContLenPos_ B)

If $iEOH_B > 0 And $iContLenPos_B > 0 Then
$sTrim2ContLen_B = StringTrimLeft($sStream_B, $iContLenPos_B + $iContLengthLen_B - 1)

$iImgLen_B = Number(StringLeft($sTrim2ContLen_B, StringInStr($sTrim2ContLen_B, @CR, 2) - 1))

$bStream_B = BinaryMid($bStream_B, $iEOH_B + 4)
EndIf
EndIf

If $iImgLen_B > 0 Then
$iStreamLen_B = BinaryLen($bStream_ B)
If $iStreamLen_B >= $iImgLen_B Then
If Not $blGUIMinimized Then
$hBMP_B = Load_BMP_From_Mem($bStream_ B)

$hHBITMAP2_B = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBMP_ B)

_WinAPI_DeleteObject(_SendMessage($hPic_B, $STM_SETIMAGE, 0, $hHBITMAP2_ B))

_GDIPlus_ImageDispose($hBMP_ B)
_WinAPI_DeleteObject($hHBITMAP2_ B)
EndIf

$iImgLen_B = 0
EndIf
EndIf
EndIf
WEnd

Share this post


Link to post
Share on other sites
FireFox

The only way I had this working is to replace the tabs by spaces (not working in raw editor mode).


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
gcue

ah ok just wanted to see if it was something i was/wasn't doing.

thanks =)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×