SlideShare ist ein Scribd-Unternehmen logo
1 von 29
ARRAY
BY : SITI MARIYAH, SST
ARRAY
Contoh array 1 dimensi:
kelasku(1,5) = {“1A”, “1B”, “1C”, “1D”, “1E”}
Data 5 kelas dimasukkan dalam satu array yang
bernama kelas.
Contoh array 2 dimensi :
kelasku(2, 3) = {(“1A”, “1B”, “1C”),(“1E”, “1F”,
“1G”)}
DIMENSION COMMAND
Logic :
DIMENSION ArrayName1(nRows1 [, nColumns1])
[AS Type] [, ArrayName2(nRows2 [,nColumns2])]
PARAMETER
1. ArrayName1  nama array
Kita bisa membuat multiple array dengan
satu dimensi hanya dengan menambahkan
nama array.
Contoh :
DIMENSION arrayName..,arrayName2…,arrayName3…
PARAMETER(2)
2. nRows1 [,nColumns1]  jumlah baris dan
kolom array
Contoh :
DIMENSION arraySatu(10)  array 1 dimensi dengan
10 baris dan 1 kolom
DIMENSION arraySatu(2,4)  array 2 dimensi
dengan 2 baris dan 4 kolom
DEKLARASI ARRAY
Contoh deklarasi :
DIMENSION arraySatu(10), arrayDua[2,4], arrayTiga(3,3)
DIMENSION arraySatu[10], arrayDua(2,4), arrayTiga[3,3]
Ukuran array tergantung pada banyaknya elemen yang
disimpan dalam array tersebut. Elemen array dapat
memiliki tipe data apa saja dan diinisialisasi False (.F.)
untuk pertama kali.
OPERASI ARRAY
STORE TO : Untuk menginisialisasi semua elemen
dengan nilai yang sama.
Contoh :
DIMENSION arraySatu(10,3)
STORE “initial” TO arraySatu
Logic di atas untuk menyimpan string initial ke
arraySatu. Sehingga initial menjadi elemen pertama
(baris1,kolom1) arraySatu
OPERASI ARRAY(2)
Array Subscript : digunakan untuk mengakses dan
manipulasi elemen array.
 Selain array subscript bisa juga menggunakan nama
array dan indeks.
 Pada array 1 dimensi, subscript digunakan untuk
mengidentifikasi nomor baris array. Contoh, subscript
untuk elemen yang berada di baris ketiga adalah 3
 Pada array 2 dimensi, subscript digunakan untuk
mengidentifikasi elemen array. Subscript yang pertama
menyatakan baris, subscript kedua menyatakan kolom
OPERASI ARRAY(3)
DIMENSION arrayName[5,2]
arrayName[1,2] = 966789
 Creates a one- or two-dimensional array.
 Visual FoxPro arrays are one-based
 DIMENSION is identical in operation and similar in
syntax to the DECLARE command
 Copies elements from one array to another array.
 Deletes an element from a one-dimensional array, or a
row or column from a two-dimensional array.
 Adds one record to the currently selected table for each
row in an array and fills each record with data from the
corresponding array row.
 Copies data from the currently selected table to an array.
 Executes the first set of commands whose conditional
expression evaluates to true (.T.).
Contoh
STORE CMONTH(DATE()) TO month
DO CASE
CASE INLIST(month, 'January', 'February', 'March')
STORE 'first quarter' TO rpt_title
CASE INLIST(month, „April', „May', „June')
STORE „second quarter' TO rpt_title
CASE INLIST(month, 'July', „August', „September')
STORE „third quarter' TO rpt_title
OTHERWISE
STORE „fourth quarter' TO rpt_title
ENDCASE
WAIT WINDOW rpt_title NOWAIT
 Executes a set of commands within a conditional loop.
 Exits a DO WHILE, FOR, SCAN, or
TRY…CATCH…FINALLY structure.
Contoh
CLOSE DATABASES OPEN DATABASE (HOME(2) + 'Datatestdata')
USE products && Opens Products table
SET TALK OFF
gnStockTot = 0
DO WHILE .T. && Begins loop
IF EOF( )
EXIT
ENDIF
IF unit_price < 20
SKIP LOOP
ENDIF
gnStockTot = gnStockTot + in_stock
SKIP
ENDDO && Ends loop
CLEAR
? 'Total items in stock valued over 20 dollars:'
?? gnStockTot
 Executes a set of commands for each element in a Visual
FoxPro array or collection.
Contoh
DIMENSION cMyArray(3)
cMyArray[1] = 'A'
cMyArray[2] = 'B'
cMyArray[3] = 'C'
FOR EACH cMyVar IN cMyArray
? cMyVar
ENDFOR
 Executes a set of commands a specified number of
times.
Contoh
FOR gnCount = 1 TO 10
? gnCount
ENDFOR
Contoh
OPEN DATABASE (HOME(2) + 'DataTestData')
USE Customer
FOR gnCount = 1 TO 10 STEP 2
GOTO gnCount
DISPLAY Company
ENDFOR
 Conditionally executes a set of commands based on the
value of a logical expression.
Contoh
USE Customer && Open customer table
GETEXPR „ Enter condition to locate ' TO gcTemp;
TYPE 'L' DEFAULT „ COMPANY = ""' LOCATE
FOR &gcTemp && Enter LOCATE expression
IF FOUND( ) && Was it found?
DISPLAY && If so, display the record
ELSE && If not found
? 'Condition ' + gcTemp + ' was not found '
&&Display a message
ENDIF
 Returns program control directly to the beginning of a
looping structure.
 Moves the record pointer through the currently selected
table and executes a block of commands for each record
that meets the specified conditions.

Weitere ähnliche Inhalte

Was ist angesagt?

The Ring programming language version 1.5.2 book - Part 22 of 181
The Ring programming language version 1.5.2 book - Part 22 of 181The Ring programming language version 1.5.2 book - Part 22 of 181
The Ring programming language version 1.5.2 book - Part 22 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88Mahmoud Samir Fayed
 
5. R basics
5. R basics5. R basics
5. R basicsFAO
 
10. Getting Spatial
10. Getting Spatial10. Getting Spatial
10. Getting SpatialFAO
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on rAbhik Seal
 
R Programming: Numeric Functions In R
R Programming: Numeric Functions In RR Programming: Numeric Functions In R
R Programming: Numeric Functions In RRsquared Academy
 
The Ring programming language version 1.5.3 book - Part 23 of 184
The Ring programming language version 1.5.3 book - Part 23 of 184The Ring programming language version 1.5.3 book - Part 23 of 184
The Ring programming language version 1.5.3 book - Part 23 of 184Mahmoud Samir Fayed
 
Spark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with SparkSpark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with Sparksamthemonad
 
The Ring programming language version 1.2 book - Part 12 of 84
The Ring programming language version 1.2 book - Part 12 of 84The Ring programming language version 1.2 book - Part 12 of 84
The Ring programming language version 1.2 book - Part 12 of 84Mahmoud Samir Fayed
 
Data made out of functions
Data made out of functionsData made out of functions
Data made out of functionskenbot
 
The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84Mahmoud Samir Fayed
 

Was ist angesagt? (20)

The Ring programming language version 1.5.2 book - Part 22 of 181
The Ring programming language version 1.5.2 book - Part 22 of 181The Ring programming language version 1.5.2 book - Part 22 of 181
The Ring programming language version 1.5.2 book - Part 22 of 181
 
The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88
 
5. R basics
5. R basics5. R basics
5. R basics
 
10. Getting Spatial
10. Getting Spatial10. Getting Spatial
10. Getting Spatial
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on r
 
R Programming: Numeric Functions In R
R Programming: Numeric Functions In RR Programming: Numeric Functions In R
R Programming: Numeric Functions In R
 
The Ring programming language version 1.5.3 book - Part 23 of 184
The Ring programming language version 1.5.3 book - Part 23 of 184The Ring programming language version 1.5.3 book - Part 23 of 184
The Ring programming language version 1.5.3 book - Part 23 of 184
 
Dplyr and Plyr
Dplyr and PlyrDplyr and Plyr
Dplyr and Plyr
 
Stack queue
Stack queueStack queue
Stack queue
 
Stack and queue
Stack and queueStack and queue
Stack and queue
 
Rsplit apply combine
Rsplit apply combineRsplit apply combine
Rsplit apply combine
 
Spark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with SparkSpark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with Spark
 
The Ring programming language version 1.2 book - Part 12 of 84
The Ring programming language version 1.2 book - Part 12 of 84The Ring programming language version 1.2 book - Part 12 of 84
The Ring programming language version 1.2 book - Part 12 of 84
 
Data made out of functions
Data made out of functionsData made out of functions
Data made out of functions
 
PAIP 第1章 Lisp入門
PAIP 第1章 Lisp入門PAIP 第1章 Lisp入門
PAIP 第1章 Lisp入門
 
CSE240 Doubly Linked Lists
CSE240 Doubly Linked ListsCSE240 Doubly Linked Lists
CSE240 Doubly Linked Lists
 
Data import-cheatsheet
Data import-cheatsheetData import-cheatsheet
Data import-cheatsheet
 
Stack, queue and hashing
Stack, queue and hashingStack, queue and hashing
Stack, queue and hashing
 
The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84
 
The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84
 

Andere mochten auch

Andere mochten auch (16)

SHS Library Annual Report 2011-2012
SHS Library Annual Report 2011-2012SHS Library Annual Report 2011-2012
SHS Library Annual Report 2011-2012
 
Kbsr
KbsrKbsr
Kbsr
 
Pemrograman Terstruktur 2
Pemrograman Terstruktur 2Pemrograman Terstruktur 2
Pemrograman Terstruktur 2
 
Bagaimana letak kod html
Bagaimana letak kod htmlBagaimana letak kod html
Bagaimana letak kod html
 
AFS Bay Area 2011-2012
AFS Bay Area 2011-2012AFS Bay Area 2011-2012
AFS Bay Area 2011-2012
 
Pemrograman Terstruktur 3
Pemrograman Terstruktur 3Pemrograman Terstruktur 3
Pemrograman Terstruktur 3
 
Pemrograman Terstruktur
Pemrograman TerstrukturPemrograman Terstruktur
Pemrograman Terstruktur
 
Trabajo BD
Trabajo BDTrabajo BD
Trabajo BD
 
Tutorial tukar template blog
Tutorial tukar template blogTutorial tukar template blog
Tutorial tukar template blog
 
CEST - Código Especificador da Substituição Tributária
CEST - Código Especificador da Substituição TributáriaCEST - Código Especificador da Substituição Tributária
CEST - Código Especificador da Substituição Tributária
 
LALUR: Revisando a parte A, entendendo a parte B
LALUR: Revisando a parte A, entendendo a parte BLALUR: Revisando a parte A, entendendo a parte B
LALUR: Revisando a parte A, entendendo a parte B
 
6th Arab Hr Conference
6th Arab Hr Conference6th Arab Hr Conference
6th Arab Hr Conference
 
Slideshow
SlideshowSlideshow
Slideshow
 
Materi Determinan (STIS)
Materi Determinan (STIS)Materi Determinan (STIS)
Materi Determinan (STIS)
 
Guia do Planejamento Tributário [e-book]
Guia do Planejamento Tributário [e-book]Guia do Planejamento Tributário [e-book]
Guia do Planejamento Tributário [e-book]
 
La crisi del'300
La crisi del'300La crisi del'300
La crisi del'300
 

Ähnlich wie Pemrograman Terstruktur 4

Ähnlich wie Pemrograman Terstruktur 4 (20)

Mysql
MysqlMysql
Mysql
 
2- Dimensional Arrays
2- Dimensional Arrays2- Dimensional Arrays
2- Dimensional Arrays
 
Fp201 unit4
Fp201 unit4Fp201 unit4
Fp201 unit4
 
ARRAYS
ARRAYSARRAYS
ARRAYS
 
Array 31.8.2020 updated
Array 31.8.2020 updatedArray 31.8.2020 updated
Array 31.8.2020 updated
 
Multi dimensional arrays
Multi dimensional arraysMulti dimensional arrays
Multi dimensional arrays
 
MA3696 Lecture 6
MA3696 Lecture 6MA3696 Lecture 6
MA3696 Lecture 6
 
Array
ArrayArray
Array
 
Homework Assignment – Array Technical DocumentWrite a technical .pdf
Homework Assignment – Array Technical DocumentWrite a technical .pdfHomework Assignment – Array Technical DocumentWrite a technical .pdf
Homework Assignment – Array Technical DocumentWrite a technical .pdf
 
Arrays
ArraysArrays
Arrays
 
Data structure array
Data structure  arrayData structure  array
Data structure array
 
Chap1 array
Chap1 arrayChap1 array
Chap1 array
 
R programming
R programmingR programming
R programming
 
Chapter13 two-dimensional-array
Chapter13 two-dimensional-arrayChapter13 two-dimensional-array
Chapter13 two-dimensional-array
 
Array,MULTI ARRAY, IN C
Array,MULTI ARRAY, IN CArray,MULTI ARRAY, IN C
Array,MULTI ARRAY, IN C
 
Intro to C# - part 2.pptx emerging technology
Intro to C# - part 2.pptx emerging technologyIntro to C# - part 2.pptx emerging technology
Intro to C# - part 2.pptx emerging technology
 
02 arrays
02 arrays02 arrays
02 arrays
 
Arrays in VbScript
Arrays in VbScriptArrays in VbScript
Arrays in VbScript
 
Arrays
ArraysArrays
Arrays
 
Data Structure Midterm Lesson Arrays
Data Structure Midterm Lesson ArraysData Structure Midterm Lesson Arrays
Data Structure Midterm Lesson Arrays
 

Kürzlich hochgeladen

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Kürzlich hochgeladen (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Pemrograman Terstruktur 4

  • 1. ARRAY BY : SITI MARIYAH, SST
  • 2. ARRAY Contoh array 1 dimensi: kelasku(1,5) = {“1A”, “1B”, “1C”, “1D”, “1E”} Data 5 kelas dimasukkan dalam satu array yang bernama kelas. Contoh array 2 dimensi : kelasku(2, 3) = {(“1A”, “1B”, “1C”),(“1E”, “1F”, “1G”)}
  • 3. DIMENSION COMMAND Logic : DIMENSION ArrayName1(nRows1 [, nColumns1]) [AS Type] [, ArrayName2(nRows2 [,nColumns2])]
  • 4. PARAMETER 1. ArrayName1  nama array Kita bisa membuat multiple array dengan satu dimensi hanya dengan menambahkan nama array. Contoh : DIMENSION arrayName..,arrayName2…,arrayName3…
  • 5. PARAMETER(2) 2. nRows1 [,nColumns1]  jumlah baris dan kolom array Contoh : DIMENSION arraySatu(10)  array 1 dimensi dengan 10 baris dan 1 kolom DIMENSION arraySatu(2,4)  array 2 dimensi dengan 2 baris dan 4 kolom
  • 6. DEKLARASI ARRAY Contoh deklarasi : DIMENSION arraySatu(10), arrayDua[2,4], arrayTiga(3,3) DIMENSION arraySatu[10], arrayDua(2,4), arrayTiga[3,3] Ukuran array tergantung pada banyaknya elemen yang disimpan dalam array tersebut. Elemen array dapat memiliki tipe data apa saja dan diinisialisasi False (.F.) untuk pertama kali.
  • 7. OPERASI ARRAY STORE TO : Untuk menginisialisasi semua elemen dengan nilai yang sama. Contoh : DIMENSION arraySatu(10,3) STORE “initial” TO arraySatu Logic di atas untuk menyimpan string initial ke arraySatu. Sehingga initial menjadi elemen pertama (baris1,kolom1) arraySatu
  • 8. OPERASI ARRAY(2) Array Subscript : digunakan untuk mengakses dan manipulasi elemen array.  Selain array subscript bisa juga menggunakan nama array dan indeks.  Pada array 1 dimensi, subscript digunakan untuk mengidentifikasi nomor baris array. Contoh, subscript untuk elemen yang berada di baris ketiga adalah 3  Pada array 2 dimensi, subscript digunakan untuk mengidentifikasi elemen array. Subscript yang pertama menyatakan baris, subscript kedua menyatakan kolom
  • 10.  Creates a one- or two-dimensional array.  Visual FoxPro arrays are one-based
  • 11.  DIMENSION is identical in operation and similar in syntax to the DECLARE command
  • 12.  Copies elements from one array to another array.
  • 13.  Deletes an element from a one-dimensional array, or a row or column from a two-dimensional array.
  • 14.  Adds one record to the currently selected table for each row in an array and fills each record with data from the corresponding array row.
  • 15.  Copies data from the currently selected table to an array.
  • 16.  Executes the first set of commands whose conditional expression evaluates to true (.T.).
  • 17. Contoh STORE CMONTH(DATE()) TO month DO CASE CASE INLIST(month, 'January', 'February', 'March') STORE 'first quarter' TO rpt_title CASE INLIST(month, „April', „May', „June') STORE „second quarter' TO rpt_title CASE INLIST(month, 'July', „August', „September') STORE „third quarter' TO rpt_title OTHERWISE STORE „fourth quarter' TO rpt_title ENDCASE WAIT WINDOW rpt_title NOWAIT
  • 18.  Executes a set of commands within a conditional loop.
  • 19.  Exits a DO WHILE, FOR, SCAN, or TRY…CATCH…FINALLY structure.
  • 20. Contoh CLOSE DATABASES OPEN DATABASE (HOME(2) + 'Datatestdata') USE products && Opens Products table SET TALK OFF gnStockTot = 0 DO WHILE .T. && Begins loop IF EOF( ) EXIT ENDIF IF unit_price < 20 SKIP LOOP ENDIF gnStockTot = gnStockTot + in_stock SKIP ENDDO && Ends loop CLEAR ? 'Total items in stock valued over 20 dollars:' ?? gnStockTot
  • 21.  Executes a set of commands for each element in a Visual FoxPro array or collection.
  • 22. Contoh DIMENSION cMyArray(3) cMyArray[1] = 'A' cMyArray[2] = 'B' cMyArray[3] = 'C' FOR EACH cMyVar IN cMyArray ? cMyVar ENDFOR
  • 23.  Executes a set of commands a specified number of times.
  • 24. Contoh FOR gnCount = 1 TO 10 ? gnCount ENDFOR
  • 25. Contoh OPEN DATABASE (HOME(2) + 'DataTestData') USE Customer FOR gnCount = 1 TO 10 STEP 2 GOTO gnCount DISPLAY Company ENDFOR
  • 26.  Conditionally executes a set of commands based on the value of a logical expression.
  • 27. Contoh USE Customer && Open customer table GETEXPR „ Enter condition to locate ' TO gcTemp; TYPE 'L' DEFAULT „ COMPANY = ""' LOCATE FOR &gcTemp && Enter LOCATE expression IF FOUND( ) && Was it found? DISPLAY && If so, display the record ELSE && If not found ? 'Condition ' + gcTemp + ' was not found ' &&Display a message ENDIF
  • 28.  Returns program control directly to the beginning of a looping structure.
  • 29.  Moves the record pointer through the currently selected table and executes a block of commands for each record that meets the specified conditions.