home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form frm_Main BackColor = &H80000004& BorderStyle = 0 'None ClientHeight = 2775 ClientLeft = 2250 ClientTop = 2250 ClientWidth = 3900 ClipControls = 0 'False ControlBox = 0 'False Height = 3180 Icon = ARRSEQ.FRX:0000 Left = 2190 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 2775 ScaleWidth = 3900 Top = 1905 Width = 4020 Begin Timer tim_message Enabled = 0 'False Interval = 700 Left = 1830 Top = 0 End Begin PictureBox pic_button AutoSize = -1 'True BorderStyle = 0 'None ClipControls = 0 'False Height = 750 Left = 0 ScaleHeight = 750 ScaleWidth = 1275 TabIndex = 2 Top = 150 Width = 1275 Begin Label lbl_Status Alignment = 2 'Center BackStyle = 0 'Transparent Caption = "lbl_Status" FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 255 Left = 30 TabIndex = 5 Top = 480 Width = 1275 End End Begin PictureBox pic_controlbox AutoSize = -1 'True BorderStyle = 0 'None Height = 150 Left = 0 Picture = ARRSEQ.FRX:0302 ScaleHeight = 150 ScaleWidth = 165 TabIndex = 4 Top = 0 Width = 165 End Begin PictureBox pic_caption BackColor = &H80000002& BorderStyle = 0 'None ClipControls = 0 'False Height = 150 Left = 0 ScaleHeight = 150 ScaleWidth = 1275 TabIndex = 3 Top = 0 Width = 1275 End Begin PictureBox pic_down AutoSize = -1 'True BorderStyle = 0 'None ClipControls = 0 'False Height = 750 Left = 2580 Picture = ARRSEQ.FRX:07B4 ScaleHeight = 750 ScaleWidth = 1275 TabIndex = 1 Top = 180 Width = 1275 End Begin PictureBox pic_up AutoSize = -1 'True BorderStyle = 0 'None ClipControls = 0 'False Height = 750 Left = 1320 Picture = ARRSEQ.FRX:10C6 ScaleHeight = 750 ScaleWidth = 1275 TabIndex = 0 Top = 150 Width = 1275 End Begin Label lbl_credits BorderStyle = 1 'Fixed Single Caption = "This simple program will re-sequence the numbering of an array's code copied to the clipboard and then copy the re-numbered code back to the clipboard. Limitations: must only copy one array to clipboard. Freeware, written by Richard Eke CompuServe 10031,233" FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 1635 Left = 60 TabIndex = 6 Top = 1020 Visible = 0 'False Width = 3705 End Option Explicit Sub Form_Load () Dim MainTop As Integer, MainLeft As Integer Me.Height = pic_button.Height + pic_controlbox.Height Me.Width = pic_button.Width '*** Get Window last pos from private INI Dim INIFile$, SectionName$, KeyWord$ Dim Def$, tmp$, nSize As Integer, Length% INIFile$ = "ARRSEQ.INI" + Chr$(0) SectionName$ = "ViewPorts" + Chr$(0) KeyWord$ = "Main_Left" + Chr$(0) Def$ = "" + Chr$(0) tmp$ = String$(255, 0) nSize = 255 Length% = GetPrivateProfileString(SectionName$, KeyWord$, Def$, tmp$, nSize, INIFile$) tmp$ = RTrim$(LTrim$(Mid$(tmp$, 1, Length%))) MainLeft = Val(tmp$) KeyWord$ = "Main_Top" + Chr$(0) Def$ = "" + Chr$(0) tmp$ = String$(255, 0) nSize = 255 Length% = GetPrivateProfileString(SectionName$, KeyWord$, Def$, tmp$, nSize, INIFile$) tmp$ = RTrim$(LTrim$(Mid$(tmp$, 1, Length%))) MainTop = Val(tmp$) '**** '*** Move window to last saved position If MainTop < 0 Or MainTop > Screen.Height Or MainLeft < 0 Or MainLeft > Screen.Width Then 'just in case invalid values put just in from top left MainTop = 240 MainLeft = 240 End If Me.Move MainLeft, MainTop pic_button.Picture = pic_up.Picture lbl_Status = "" '*************************************************************** ' In many of my programs I have fixed data stored in 'sequentialy numbered arrays. This is normally in instances 'where I wouldn't use a file as I don't want the users 'changing the data - i.e. simulating BASIC's DATA statement 'The main instance that I use this method is in my setup 'program for the lists of files that need to be installed. 'Over the course of time, items are added and deleted and it 'is a real pain to re-number the subsequent array elements 'by hand. Thus this very simple program. This program 'has great scope for improvement but it works well within 'it's limitations. 'Use: ' Copy the code to the clipboard ' click on 'Array Sequencer' ' Paste the code back into the code window 'Limitations:- ' Only copy one array to the clipboard or it will go wrong ' Make sure that the first array element is numbered ' correctly - it uses this as the start index 'Freeware - I only hope it's usefull to someone <g> 'Richard Eke, CompuServe 100031,233 - 29th Sept 1995 '************************************************************* End Sub Sub Form_Unload (Cancel As Integer) '*** Save pos in INI Dim INIFile$, SectionName$, KeyWord$ Dim Def$, tmp$, nSize As Integer, Length%, Done% INIFile$ = "ARRSEQ.INI" SectionName$ = "ViewPorts" + Chr$(0) KeyWord$ = "Main_Left" + Chr$(0) tmp$ = Format$(frm_Main.Left) + Chr$(0) Done% = WritePrivateProfileString(SectionName$, KeyWord$, tmp$, INIFile$) KeyWord$ = "Main_Top" + Chr$(0) tmp$ = Format$(frm_Main.Top) + Chr$(0) Done% = WritePrivateProfileString(SectionName$, KeyWord$, tmp$, INIFile$) End Sub Sub pic_button_Click () Dim OriginalText As String Dim FinalText As String Dim ThisIndex As Integer Dim c As Integer ThisIndex = -9999 ShowMsg "Processing..." pic_button.MousePointer = 11'hourglass If ClipBoard.GetFormat(1) Then '*** is there text on Clipboard OriginalText = ClipBoard.GetText() c = 0 Do c = c + 1 If Mid$(OriginalText, c, 1) <> "(" Then FinalText = FinalText + Mid$(OriginalText, c, 1) Else If ThisIndex = -9999 Then '*** Find first index ThisIndex = Val(Mid$(OriginalText, c + 1, InStr(c, OriginalText, ")"))) End If FinalText = FinalText + "(" + Format$(ThisIndex) + ")" ThisIndex = ThisIndex + 1 c = InStr(c, OriginalText, ")") End If Loop Until c >= Len(OriginalText) ClipBoard.SetText FinalText ShowMsg "Processed OK" Else MsgBox "No text on Clipbard", 16, "Error" ShowMsg "No Data" End If pic_button.MousePointer = 0'default End Sub Sub pic_button_MouseDown (button As Integer, Shift As Integer, X As Single, Y As Single) pic_button.Picture = pic_down.Picture End Sub Sub pic_button_MouseUp (button As Integer, Shift As Integer, X As Single, Y As Single) pic_button.Picture = pic_up.Picture End Sub Sub pic_caption_MouseDown (button As Integer, Shift As Integer, X As Single, Y As Single) Dim ret! '*** Trigger the mouse-up event NOW ret! = Sendmessage(pic_caption.hWnd, WM_LBUTTONUP, 0, 0) '*** Tell Windows were's moving the window ret! = Sendmessage(frm_Main.hWnd, WM_SYSCOMMAND, MOUSE_MOVE, 0) End Sub Sub pic_controlbox_DblClick () Unload Me End Sub Sub ShowMsg (MsgTxt As String) '*** Leave message on screen for a short while to give '*** users chance to read it lbl_Status.Caption = MsgTxt lbl_Status.Refresh tim_Message.Enabled = True End Sub Sub tim_message_Timer () lbl_Status.Caption = "" tim_Message.Enabled = False End Sub