PowerBuilder Array Object
Source Code
nvo_array from nonvisualobject
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | forward global type nvo_array from nonvisualobject end type end forward global type nvo_array from nonvisualobject autoinstantiate end type forward prototypes public function integer of_sort (ref any aa_list[], integer ai_order) public function integer of_sort (ref any aa_list[]) public function integer of_insert (ref any aa_list[], any aa_element, long al_position) public function integer of_add (ref any aa_list[], any aa_element) public function integer of_remove (ref any aa_list[], long al_position) public function integer of_remove (ref any aa_list[], long al_pos, long al_len) public function long of_find (ref any aa_list[], any aa_element, long al_start, long al_end) public function long of_find (ref any aa_list[], any aa_element, long al_start) public function long of_find (ref any aa_list[], any aa_element) end prototypes public function integer of_sort (ref any aa_list[], integer ai_order);//==================================================================== // Function: nvo_array.of_sort() //-------------------------------------------------------------------- // Description: Sort a list of sortable data //-------------------------------------------------------------------- // Arguments: // reference any aa_list[] An array of data to be sorted // value integer ai_order 0 - ascending; 1 - descending //-------------------------------------------------------------------- // Returns: integer //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/30 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Long ll_bound, ll_i, ll_len, ll_max, ll_pos String ls_type datastore lds_1 //Check argument If IsNull (ai_order) Or ai_order > 1 Or ai_order < 0 Then Return -1 ll_bound = UpperBound(aa_list[]) Choose Case ll_bound Case 0 Return -1 Case 1 Return 0 End Choose ls_type = ClassName (aa_list[1]) Choose Case ls_type Case 'string' //string //Determine that maximum length of string For ll_i = 1 To ll_bound ll_len = Len (String(aa_list[ll_i])) If ll_len > ll_max Then ll_max = ll_len Next ls_type = 'char(' + String(ll_max) + ')' Case 'integer','unsignedinteger', 'number', & 'long', 'ulong', 'unsignedlong','decimal' //numerical data promoted to decimal //Determine that maximum number of decimal places For ll_i = 1 To ll_bound ll_pos = Pos (String(aa_list[ll_i]), '.') If ll_pos > 0 Then ll_len = Len (String(aa_list[ll_i])) - ll_pos If ll_pos > ll_max Then ll_max = ll_pos Next ls_type = 'decimal(' + String (ll_max) + ')' Case 'date', 'datetime', 'real', 'time' //Legitimate Data type Case Else //unsortable or unsuported data type Return -1 End Choose lds_1 = Create datastore // Generate data object lds_1.Create('release 5; datawindow() table(column=(type=' + & ls_type + ' name=dummy dbname="dummy" ))') //Assign data to datastore lds_1.Object.dummy.Primary = aa_list //set sort order If ai_order = 0 Then lds_1.SetSort("#1 A") Else lds_1.SetSort("#1 D") End If lds_1.Sort() //Get data from datastore aa_list = lds_1.Object.dummy.Primary Destroy lds_1 Return 1 end function public function integer of_sort (ref any aa_list[]);//==================================================================== // Function: nvo_array.of_sort() //-------------------------------------------------------------------- // Description: Sort a list of sortable data in ascending order //-------------------------------------------------------------------- // Arguments: // reference any aa_list[] An array of data to be sorted //-------------------------------------------------------------------- // Returns: integer: 1 Sort successfully, -1 If any arguments are invalid, 0 No action has been taken //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/30 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return of_sort (aa_list, 0) end function public function integer of_insert (ref any aa_list[], any aa_element, long al_position);//==================================================================== // Function: nvo_array.of_insert() //-------------------------------------------------------------------- // Description: insert an element or array into an array //-------------------------------------------------------------------- // Arguments: // reference any aa_list[] The specified array // value any aa_element The content of the element or an array // value long al_position The position where to insert the element, If al_position = 0 or greater then the upper bound then append the element to the array //-------------------------------------------------------------------- // Returns: integer: 1 insert successfully, -1 failed to insert the element //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/30 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Long ll_bound1, ll_bound2, ll_i, ll_j Any la_element[] //Check argument If IsNull (aa_list[]) Or & IsNull (al_position) Or al_position < 0 Then Return -1 If ClassName (aa_element) = 'any' Then la_element = aa_element Else la_element[1] = aa_element End If ll_bound1 = UpperBound(aa_list[]) ll_bound2 = UpperBound(la_element[]) If al_position = 0 Then al_position = ll_bound1 + 1 If al_position < ll_bound1 Then //move the seocnd portion of list1 to the end ll_bound1 = ll_bound1 + ll_bound2 ll_j = al_position + ll_bound2 For ll_i = ll_bound1 To ll_j Step -1 aa_list[ll_i ] = aa_list[ll_i - ll_bound2 ] Next End If //Assing elements of list2 to list1 al_position = al_position - 1 For ll_i = 1 To ll_bound2 aa_list[al_position + ll_i ] = la_element[ll_i] Next Return 1 end function public function integer of_add (ref any aa_list[], any aa_element);//==================================================================== // Function: nvo_array.of_add() //-------------------------------------------------------------------- // Description: add an element to an array //-------------------------------------------------------------------- // Arguments: // reference any aa_list[] The specified array // value any aa_element The content of the element to be added //-------------------------------------------------------------------- // Returns: integer: 1 add the element successfully, -1 failed to insert the element //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/30 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return of_insert (aa_list, aa_element, UpperBound (aa_list[]) + 1) end function public function integer of_remove (ref any aa_list[], long al_position);//==================================================================== // Function: nvo_array.of_remove() //-------------------------------------------------------------------- // Description: remove an element from an array //-------------------------------------------------------------------- // Arguments: // reference any aa_list[] The specified array // value long al_position The position where the element to be removed //-------------------------------------------------------------------- // Returns: integer: 1 remove successfully, -1 failed to remove the element //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/30 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return of_remove (aa_list, al_position, 1) end function public function integer of_remove (ref any aa_list[], long al_pos, long al_len);//==================================================================== // Function: nvo_array.of_remove() //-------------------------------------------------------------------- // Description: remove array elements from position1 to position2 //-------------------------------------------------------------------- // Arguments: // reference any aa_list[] The specified array // value long al_pos The position of the first element to be removed // value long al_len The length of elements to be removed //-------------------------------------------------------------------- // Returns: integer: 1 remove successfully, 0 no action has been taken, -1 failed to remove the element //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/30 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Long ll_bound, ll_i Any la_list[] //Check argument If IsNull (aa_list[]) Or IsNull (al_pos) Or al_pos <= 0 Or & IsNull (al_len) Or al_len <= 0 Then Return -1 ll_bound = UpperBound (aa_list[]) If al_pos > ll_bound Then Return 0 // Get the elements before al_pos al_pos -- For ll_i = 1 To al_pos la_list[ll_i] = aa_list [ll_i] Next //Set the position to the last removed element al_pos = al_pos + al_len If al_pos < ll_bound Then //Redefine the upper bound ll_bound = ll_bound - al_len //get the remaining elements For ll_i = ll_i To ll_bound al_pos ++ la_list[ll_i] = aa_list[al_pos] Next End If aa_list = la_list Return 1 end function public function long of_find (ref any aa_list[], any aa_element, long al_start, long al_end);//==================================================================== // Function: nvo_array.of_find() //-------------------------------------------------------------------- // Description: find an element in an array between two positions //-------------------------------------------------------------------- // Arguments: // reference any aa_list[] The specified array // value any aa_element The content of the element // value long al_start The starting position // value long al_end The ending position //-------------------------------------------------------------------- // Returns: long: the poisiton of the found element, 0 the element is not found , -1 error //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/30 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Long ll_bound, ll_i //Check argument If IsNull (aa_list[]) Or IsNull (aa_element) & Or IsNull (al_start) Or al_start <= 0 & Or IsNull (al_end) Or al_end <= 0 & Then Return -1 ll_bound = UpperBound(aa_list[]) If al_end < al_start Then //Swap al_start and al_end ll_i = al_start al_start = al_end al_end = ll_i End If //check the range of starting position If al_start > ll_bound Then Return 0 //check the range of the ending position If al_end > ll_bound Then al_end = ll_bound For ll_i = al_start To al_end If aa_list[ll_i] = aa_element Then Return ll_i Next Return 0 end function public function long of_find (ref any aa_list[], any aa_element, long al_start);//==================================================================== // Function: nvo_array.of_find() //-------------------------------------------------------------------- // Description: find an element in an array from the starting position //-------------------------------------------------------------------- // Arguments: // reference any aa_list[] The specified array // value any aa_element The content of the element // value long al_start The starting position //-------------------------------------------------------------------- // Returns: long: the poisiton of the found element, 0 the element is not found, -1 error //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/30 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return of_find (Ref aa_list[], aa_element, al_start, UpperBound (aa_list[])) end function public function long of_find (ref any aa_list[], any aa_element);//==================================================================== // Function: nvo_array.of_find() //-------------------------------------------------------------------- // Description: find an element in an array in the whole range //-------------------------------------------------------------------- // Arguments: // reference any aa_list[] The specified array // value any aa_element The content of the element //-------------------------------------------------------------------- // Returns: long the poisiton of the found element, 0 the element is not found, -1 error //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/30 //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Return of_find (Ref aa_list[], aa_element, 1, UpperBound (aa_list[])) end function on nvo_array.create call super::create TriggerEvent( this, "constructor" ) end on on nvo_array.destroy TriggerEvent( this, "destructor" ) call super::destroy end on |
Window Example w_main from window
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | forward global type w_main from window end type type cb_add from commandbutton within w_main end type type sle_s7 from singlelineedit within w_main end type type cb_insert from commandbutton within w_main end type type sle_s6 from singlelineedit within w_main end type type cb_remove from commandbutton within w_main end type type cb_sortd from commandbutton within w_main end type type sle_s5 from singlelineedit within w_main end type type sle_5 from singlelineedit within w_main end type type sle_4 from singlelineedit within w_main end type type sle_3 from singlelineedit within w_main end type type sle_2 from singlelineedit within w_main end type type sle_1 from singlelineedit within w_main end type type sle_s3 from singlelineedit within w_main end type type sle_s2 from singlelineedit within w_main end type type sle_s4 from singlelineedit within w_main end type type sle_s1 from singlelineedit within w_main end type type cb_sorta from commandbutton within w_main end type type gb_2 from groupbox within w_main end type type gb_1 from groupbox within w_main end type end forward global type w_main from window integer x = 1070 integer y = 480 integer width = 1426 integer height = 1660 boolean titlebar = true string title = "Array Service Object Sample" boolean controlmenu = true boolean minbox = true boolean maxbox = true boolean resizable = true long backcolor = 79741120 cb_add cb_add sle_s7 sle_s7 cb_insert cb_insert sle_s6 sle_s6 cb_remove cb_remove cb_sortd cb_sortd sle_s5 sle_s5 sle_5 sle_5 sle_4 sle_4 sle_3 sle_3 sle_2 sle_2 sle_1 sle_1 sle_s3 sle_s3 sle_s2 sle_s2 sle_s4 sle_s4 sle_s1 sle_s1 cb_sorta cb_sorta gb_2 gb_2 gb_1 gb_1 end type global w_main w_main type prototypes end prototypes type variables singlelineedit sle_input[], sle_result[] end variables on w_main.create this.cb_add=create cb_add this.sle_s7=create sle_s7 this.cb_insert=create cb_insert this.sle_s6=create sle_s6 this.cb_remove=create cb_remove this.cb_sortd=create cb_sortd this.sle_s5=create sle_s5 this.sle_5=create sle_5 this.sle_4=create sle_4 this.sle_3=create sle_3 this.sle_2=create sle_2 this.sle_1=create sle_1 this.sle_s3=create sle_s3 this.sle_s2=create sle_s2 this.sle_s4=create sle_s4 this.sle_s1=create sle_s1 this.cb_sorta=create cb_sorta this.gb_2=create gb_2 this.gb_1=create gb_1 this.Control[]={this.cb_add,& this.sle_s7,& this.cb_insert,& this.sle_s6,& this.cb_remove,& this.cb_sortd,& this.sle_s5,& this.sle_5,& this.sle_4,& this.sle_3,& this.sle_2,& this.sle_1,& this.sle_s3,& this.sle_s2,& this.sle_s4,& this.sle_s1,& this.cb_sorta,& this.gb_2,& this.gb_1} end on on w_main.destroy destroy(this.cb_add) destroy(this.sle_s7) destroy(this.cb_insert) destroy(this.sle_s6) destroy(this.cb_remove) destroy(this.cb_sortd) destroy(this.sle_s5) destroy(this.sle_5) destroy(this.sle_4) destroy(this.sle_3) destroy(this.sle_2) destroy(this.sle_1) destroy(this.sle_s3) destroy(this.sle_s2) destroy(this.sle_s4) destroy(this.sle_s1) destroy(this.cb_sorta) destroy(this.gb_2) destroy(this.gb_1) end on event open;sle_input[1] = sle_1 sle_input[2] = sle_2 sle_input[3] = sle_3 sle_input[4] = sle_4 sle_input[5] = sle_5 sle_result[1] = sle_s1 sle_result[2] = sle_s2 sle_result[3] = sle_s3 sle_result[4] = sle_s4 sle_result[5] = sle_s5 sle_result[6] = sle_s6 end event type cb_add from commandbutton within w_main integer x = 928 integer y = 1044 integer width = 379 integer height = 84 integer taborder = 50 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" string text = "&Add" end type event clicked;long ll_i, ll_bound any la_list[], la_element[1] nvo_array lnv_array //Get the list from the input For ll_i = 1 to 5 la_list[ll_i] = sle_input[ll_i].text Next la_element[1] = sle_s7.text //insert an element into the list lnv_array.of_add (la_list, la_element) //clean up the previous results For ll_i = 1 to 6 sle_result[ll_i].text = '' Next //display the results ll_bound = Upperbound (la_list[]) For ll_i = 1 to ll_bound sle_result[ll_i].text = la_list[ll_i] Next end event type sle_s7 from singlelineedit within w_main integer x = 928 integer y = 840 integer width = 375 integer height = 84 integer taborder = 110 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 string text = "Test Array" boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type cb_insert from commandbutton within w_main integer x = 928 integer y = 952 integer width = 379 integer height = 84 integer taborder = 40 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" string text = "&Insert (3)" end type event clicked;long ll_i, ll_bound any la_list[], la_element[] nvo_array lnv_array //Get the list from the input For ll_i = 1 to 5 la_list[ll_i] = sle_input[ll_i].text Next la_element[1] = sle_s7.text //insert an element into the list lnv_array.of_insert(la_list, la_element, 3) //clean up the previous results For ll_i = 1 to 6 sle_result[ll_i].text = '' Next //display the results ll_bound = Upperbound (la_list[]) For ll_i = 1 to ll_bound sle_result[ll_i].text = la_list[ll_i] Next end event type sle_s6 from singlelineedit within w_main integer x = 110 integer y = 1356 integer width = 667 integer height = 84 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type cb_remove from commandbutton within w_main integer x = 928 integer y = 340 integer width = 379 integer height = 84 integer taborder = 30 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" string text = "&Remove (3, 2)" end type event clicked;long ll_i, ll_bound any la_list[], la_element nvo_array lnv_array //Get the list from the input For ll_i = 1 to 5 la_list[ll_i] = sle_input[ll_i].text Next //insert an element into the list lnv_array.of_remove(la_list, 3, 2) //clean up the previous results For ll_i = 1 to 6 sle_result[ll_i].text = '' Next //display the results ll_bound = Upperbound (la_list[]) For ll_i = 1 to ll_bound sle_result[ll_i].text = la_list[ll_i] Next end event type cb_sortd from commandbutton within w_main integer x = 928 integer y = 240 integer width = 379 integer height = 84 integer taborder = 20 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" string text = "Sort (&D)" end type event clicked;long ll_i, ll_bound any la_list[] nvo_array lnv_array //Get the list from the input For ll_i = 1 to 5 la_list[ll_i] = sle_input[ll_i].text Next //sort the list lnv_array.of_sort(la_list, 1) //clean up the previous results For ll_i = 1 to 6 sle_result[ll_i].text = '' Next //display the results ll_bound = Upperbound (la_list[]) For ll_i = 1 to ll_bound sle_result[ll_i].text = la_list[ll_i] Next end event type sle_s5 from singlelineedit within w_main integer x = 110 integer y = 1252 integer width = 667 integer height = 84 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type sle_5 from singlelineedit within w_main integer x = 110 integer y = 540 integer width = 667 integer height = 84 integer taborder = 100 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 string text = "com" boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type sle_4 from singlelineedit within w_main integer x = 110 integer y = 436 integer width = 667 integer height = 84 integer taborder = 90 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 string text = "IT" boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type sle_3 from singlelineedit within w_main integer x = 110 integer y = 332 integer width = 667 integer height = 84 integer taborder = 80 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 string text = "Method" boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type sle_2 from singlelineedit within w_main integer x = 110 integer y = 224 integer width = 667 integer height = 84 integer taborder = 70 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 string text = "Programming" boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type sle_1 from singlelineedit within w_main integer x = 110 integer y = 124 integer width = 667 integer height = 84 integer taborder = 60 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 string text = "PowerBuilder" boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type sle_s3 from singlelineedit within w_main integer x = 110 integer y = 1044 integer width = 667 integer height = 84 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type sle_s2 from singlelineedit within w_main integer x = 110 integer y = 940 integer width = 667 integer height = 84 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type sle_s4 from singlelineedit within w_main integer x = 110 integer y = 1148 integer width = 667 integer height = 84 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type sle_s1 from singlelineedit within w_main integer x = 110 integer y = 836 integer width = 667 integer height = 84 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type cb_sorta from commandbutton within w_main integer x = 928 integer y = 148 integer width = 379 integer height = 84 integer taborder = 10 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" string text = "Sort (&A)" end type event clicked;long ll_i, ll_bound any la_list[] nvo_array lnv_array //Get the list from the input For ll_i = 1 to 5 la_list[ll_i] = sle_input[ll_i].text Next //sort the list lnv_array.of_sort(la_list) //clean up the previous results For ll_i = 1 to 6 sle_result[ll_i].text = '' Next //display the results ll_bound = Upperbound (la_list[]) For ll_i = 1 to ll_bound sle_result[ll_i].text = la_list[ll_i] Next end event type gb_2 from groupbox within w_main integer x = 18 integer y = 732 integer width = 850 integer height = 772 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 long backcolor = 79741120 string text = "Results" end type type gb_1 from groupbox within w_main integer x = 18 integer y = 20 integer width = 850 integer height = 652 integer textsize = -8 integer weight = 400 fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "MS Sans Serif" long textcolor = 33554432 long backcolor = 79741120 string text = "Input" end type |
Find Projects On Github click here
Good Luck!